Closed
Description
I'm using the byte iterator to get the bytes from a file, and it seems this post is still relevant.
This is my benchmark code:
Direct:
head -c 10000000 /dev/urandom > rand; time ./xorsum rand
Out:
a22b487c4955107f rand
real 0m7.210s
user 0m2.398s
sys 0m4.810s
Redirect:
head -c 10000000 /dev/urandom > rand; time ./xorsum < rand
Out:
5ae99bfc1279743c -
real 0m0.330s
user 0m0.326s
sys 0m0.004s
xorsum
is the crate I'm developing. The code I benched is not exactly the same as the one in my repo (Currently. I'll commit my local clone in some minutes after doing some minor changes)
And yes, I ran cargo build -r
to optimize it. Memory-mapping and file-caching shouldn't affect bench results, because I always used random data
Update: permalink to the commit
Metadata
Metadata
Assignees
Labels
No labels