ad-oliviero / uwufetch

A meme system info tool for Linux, based on nyan/uwu trend on r/linuxmasterrace.
GNU General Public License v3.0
747 stars 48 forks source link

Speed #118

Closed Joshix-1 closed 2 years ago

Joshix-1 commented 3 years ago

2021-07-23_17-25

paleofetch and fastfetch are way faster than uwufetch.

The command: DATE1=$(date +%s%N) ; uwufetch > /dev/null ; DATE2=$(date +%s%N) ; echo "$(expr $(expr $DATE2 - $DATE1) / 1000000)ms"

ad-oliviero commented 3 years ago

I know, it's even worse on slower PCs (on the slowest system I own, it takes as long as 20 seconds). It definitely needs optimization, I'm not an expert in optimizing programs, but I think that it could be useful to use multiple threads for getting info.

dqnk commented 3 years ago

(on the slowest system I own, it takes as long as 20 seconds).

But is that with ASCII art or with viu images? It would be possible to make parts of this program multi threaded, but the main reason why this is slower than paleofetch or fastfetch and can't be insanely optimized as I see it is that it supports so many different systems, not just GNU/Linux on Xorg.

ad-oliviero commented 3 years ago

But is that with ASCII art or with viu images?

Just ASCII art: obviously not my main system, not even my 4th

the main reason why this is slower than paleofetch or fastfetch and can't be insanely optimized as I see it is that it supports so many different systems, not just GNU/Linux on Xorg.

Also there are too many if statements (96 to be precise) and I am pretty sure that this also affects performance.

Guaxinim5573 commented 3 years ago

After testing, I saw that pkgman function is the slowest one. After commenting line 645, this is the result. image Both compiled with cc.

EDIT: Running the same test a few times, and including fastfetch in the results. image Without pkgman function, uwufetch is twice as fast as the latest one but still not as fast as fastfetch.

ad-oliviero commented 3 years ago

That's a nice result, but on my laptop commenting the same line, I get almost no difference and I don't know why