You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GNU uses a much larger buffer size (512 vs 65536), which is probably much more efficient and they achieve in just 2 syscalls what takes uutils 152 syscalls.
I was wrong here below is the corrected version (or click here to expand)
There is a bit of an interesting twist, which is that uutils is much faster one some large files. Here, I made the test file 1GB:
❯ time ./target/release/coreutils shred test
________________________________________________________
Executed in 8.72 secs fish external
usr time 2.98 secs 1.02 millis 2.98 secs
sys time 4.64 secs 0.14 millis 4.64 secs
❯ time shred test
________________________________________________________
Executed in 69.59 secs fish external
usr time 2.13 secs 447.00 micros 2.13 secs
sys time 0.90 secs 61.00 micros 0.90 secs
So maybe the small buffer size just works better? I'm not sure what other difference could have such a large impact? Maybe uutils is using a different faster source of randomness?
I made a big mistake in the benchmarks above, which is that they were operating on the same file, if I create new files each time (with truncate) I get:
GNU: ~5 seconds
uutils with a small buffer: 10 - 20 seconds
uutils with a large buffer: 3.5 - 53 seconds
So I guess the conclusion is that IO is hard to measure 😄
The text was updated successfully, but these errors were encountered:
Discovered while investigating #4488
Compare these excerpts from
strace
:uutils
GNU
GNU uses a much larger buffer size (512 vs 65536), which is probably much more efficient and they achieve in just 2 syscalls what takes uutils 152 syscalls.
I was wrong here below is the corrected version (or click here to expand)
There is a bit of an interesting twist, which is that
uutils
is much faster one some large files. Here, I made the test file 1GB:So maybe the small buffer size just works better? I'm not sure what other difference could have such a large impact? Maybe uutils is using a different faster source of randomness?
I made a big mistake in the benchmarks above, which is that they were operating on the same file, if I create new files each time (with
truncate
) I get:So I guess the conclusion is that IO is hard to measure 😄
The text was updated successfully, but these errors were encountered: