inikep / lzbench

lzbench is an in-memory benchmark of open-source LZ77/LZSS/LZMA compressors
894 stars 182 forks source link

Piping through tee doesn't work #138

Open tansy opened 7 months ago

tansy commented 7 months ago

Whenever I want to write result from the screen to file I redirect or pipe through tee (1) but here it doesn't work. Nothing gets onto the screen, only at the end of the program it is written to the file, along with Bunch of other logging stuff.

I don't know where it come from as program uses printf() to write on the screen/stdout.

$ lzbench -ezlib,1 lzbench > log
$ lzbench -ezlib,1 lzbench | tee log
ChristianSchindler commented 7 months ago

I used ./lzbench -r -v -elz4/zstd/snappy silesia > result.txt and it did work for me

tansy commented 7 months ago

And what did you see on the screen?

Same with tee, but one would expect to see something on the screen.

Try this (below) and check the difference between lzbench file | tee log.

$ while [ true ]; do echo $i; i=$((i+1)); sleep 1; done | tee log

And compare it to this (which is what you propose):

$ while [ true ]; do echo $i; i=$((i+1)); sleep 1; done > log

Do you see a difference?