Results 1 to 6 of 6
I've been trying to use the time command to benchmark the speeds of LZMA, GZIP, and BZIP2.
So far I've come up with this command:
Code:
for a in 100; ...
- 10-07-2009 #1Just Joined!
- Join Date
- Oct 2009
- Posts
- 4
Using the Time command for Benchmarking
I've been trying to use the time command to benchmark the speeds of LZMA, GZIP, and BZIP2.
So far I've come up with this command:
But the problem is, the Time command seems to be able to intercept my | between Time and Sed. I have the sed to write to a file that would have the data in it.Code:for a in 100; do for b in "bzip2" "lzma" "gzip"; do dd if=/dev/zero of=$a.$b.zero bs=${a}M count=1; time $b $a.$b.zero > $a.$b | sed "s|.* [0-9\.]*s user [0-9\.]*s system [0-9]*% cpu \([0-9\.]*\) total|\1|" >> benchmark; echo -n "," >> benchmark; done; echo >> benchmark; done
Is there anyway I could make this work?
Note: So eventually I want to be able to run:
And see a graph of the time it takes to compress each compression format.Code:gnuplot -persist <(echo "plot 'benchmark' with lines")
- 10-07-2009 #2
Please format your code so that it can be read without horizontal scrolling.But the problem is, the Time command seems to be able to intercept my | between Time and Sed. I have the sed to write to a file that would have the data in it.Code:for a in 100 do for b in "bzip2" "lzma" "gzip" do dd if=/dev/zero of=$a.$b.zero bs=${a}M count=1 time $b $a.$b.zero > $a.$b | sed "s|.* [0-9\.]*s user [0-9\.]*s system [0-9]*% cpu \([0-9\.]*\) total|\1|" >> benchmark echo -n "," >> benchmark done echo >> benchmark done
Is there anyway I could make this work?
If you want to capture the output ot time:
Code:{ time $b $a.$b.zero > $a.$b ; } 2>&2 |
- 10-10-2009 #3Just Joined!
- Join Date
- Oct 2009
- Posts
- 4
Thanks for the help, but it's still not working.
For example:
Will still just replace the "ls" not the "time" and if possible I'd like to stop the "ls" from displaying anything. I don't quite understand the whole 2>&2 thing so you're going to have to help me.Code:{ time ls; } 2>&2 | sed "s|.*|123|"
- 10-12-2009 #4Just Joined!
- Join Date
- Oct 2009
- Posts
- 4
bump bump
- 10-16-2009 #5Just Joined!
- Join Date
- Oct 2009
- Posts
- 4
bump bump.
- 04-10-2012 #6



