musl-cross-make
musl-cross-make copied to clipboard
Suggestion: Remove verbose extraction
Is there any reason to keep verbose mode on when extracting? As far as I'm concerned it just makes it take longer than it should.
Not in particular, but it's just part of a general principle of not hiding visual progress indication.
I just measured and the time difference is miniscule here, 29.0s vs 27.7s. If it's slow for you, the slowness is probably a bad terminal that renders synchronously and blocks while rendering (all the gnome-vte based ones) and redirecting the whole build to a file or using a better terminal would make a huge difference compared to just saving time at extraction.
Seems likely, but in my case it's probably because I'm using WSL. It's not exactly fast...
I think it would make more sense to just print a message when extraction has started and finished. Alternatively, we could make the script print a dot (.
) with no line break at the end for every file extracted, so that progress would still be visible somehow.
you could simply use tar xf instead of tar xvf, @Calinou
@rofl0r That can be done too, but I was answering @richfelker's concern about hiding progress (especially on slow machines).
So piping stdout into some program that counts lines and prints a dot for each one? Something like this:
tar -xvf gcc-8.3.0.tar.bz2 | awk '{printf "."}'
would propably be fine then, and also wouldn't slow down because of 'bad' terminals like the gnome-based ones.
With big codebases like gcc, only printing every 30+ files would probably be a good idea:
tar -xvf gcc-8.3.0.tar.bz2 | awk '{if(NR%30==0)printf "."}'
(I have no idea what this will do to overall performance, but I can't imagine it doing much. I am not even close to any linux machine at the moment, so I can't test this)
I don't think this is a speed issue but a noise issue. When you build musl-cross-make, the first 125 thousand lines of output are just from extracting archives. That's not meaningful information, that's just ~10MB of noise.
I would suggest removing the verbose flag from all tar commands.
If users really want to watch files be unpacked, they can use the TAR_OPTIONS
environment variable to re-insert the verbose flag.