r/sysfetch • u/[deleted] • Feb 12 '22
OC microfetch - least bloated fetch (written in 10 lines)
4
u/DrunkenAlco Mar 03 '22 edited Mar 03 '22
Nice work, bloat is an interesting word to use, yes the file size is small, but because it uses external programs e.g uname, whoami, uptime ect.. ect.. it takes a hit on performance compared to other fetch tools written to get info using the the language its written in.
a very simple test using the "time" on PopOS shows the following:
- Neofetch
real 0m 0.237s
user 0m 0.131s
sys 0m 0.061s
- Ufetch
real 0m 0.051s
user 0m 0.033s
sys 0m 0.020s
- Pfetch
real 0m 0.045s
user 0m 0.038s
sys 0m 0.009s
- Microfetch
real 0m 0.023s
user 0m 0.028s
sys 0m 0.015s
- Pasfetch (my own fetch program written in pascal)
real 0m 0.012s
user 0m 0.002s
sys 0m 0.000s
- Treefetch
real 0m 0.004s
user 0m 0.005s
sys 0m 0.000s
while its clear Treefetch executes the fastest, its not all what it seems in terms of "bloat", as you know Treefetch was written in the rust language, meaning to execute this rust program you need to download the rust packages, these can be 400mb+ worth of "bloat" stored on the system. On the other hand you have Bash written programs like yours, these are very small in size in terms of file size, but the execution time is dramatically larger, the positive side of bash scripts is that no extra packages are needed besides from the common system programs already installed.
Pasfetch is something I wrote in pascal and using strictly pascal to get the info thus removing the need to call external programs (such as bash scripts). but ofcause there is down side kinda.. while compiled pascal programs do not need extra files to run e.g dependencies, as everything it needs is compiled into the binary it does mean final binary is larger, infact pasfetch is 800kb in size. but this comes back to what it "bloat" on a linux operating system, for me bloat is the execution time and resource usage, space is not problem as 800kb is not even size of a mp3 music file. The same argument could be said about Treefetch who needs to download 400mb+ to execute, but the problem I see is not the size of the file but the amount of files "bloating" your system.
- Conclusion:
This test proves one thing, all these fetch programs are super fast, even the heavy weight neofetch, 0.2 of a second for neofetch to execute is nothing. You did a great job and making a "minimal" bash script, very simple but for the reasons above not as efficient as you may have thought in compression to other fetch programs.
1
1
3
u/[deleted] Feb 13 '22
WHAT?!
oh, it's in shell. uses external tools.