-
-
Notifications
You must be signed in to change notification settings - Fork 2
BlockRng optimizations
#40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Benchmarks (using https://github.com/rust-random/rand/pull/1697)
|
|
So, I tried copying the
Eliminating the temporary buffer in So I won't use this code, mainly on the grounds of increased code size and |
Summary
Optimize
fill_bytesandnext_u64_from_u32Details
Eliminates an impossible-to-reach panic in
fill_bytes'schunks.into_remainderhandling.Reduces
next_u64_from_u32to a singlecallinstruction.I'm not sure the result is optimal (there are several possible jumps in
fill_bytes's chunk-iterator / memcpy code) but it's all I have time for and likely good enough.Code on godbolt.
Benchmarks in progress...