-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Use const generics in SipHasher128's short_write #93671
Conversation
4535515
to
5fc2e56
Compare
Well, in principle this is covered by the spill capacity check but it's more explicit that way. It's hot code and might impact compile time even though I don't really expect it to, so no rollup. |
📌 Commit 5fc2e56 has been approved by |
⌛ Testing commit 5fc2e56 with merge 5c7c1a0f448ae46a5ef8becb90b398893372a851... |
💥 Test timed out |
☀️ Test successful - checks-actions |
Finished benchmarking commit (fc32303): comparison url. Summary: This benchmark run did not return any relevant results. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
This was proposed by @michaelwoerister here.
A few comments:
&[u8; LEN]
instead of[u8; LEN]
. Locally, it resulted in small icount regressions (about 0.5 %). When passing by value, there were no regressions (and no improvements).to_ne_bytes()
inSipHasher128
to keep it generic and only useto_le_bytes()
inStableHasher
. However, currentlySipHasher128
is only used inStableHasher
and theshort_write
method was private, so I couldn't use it directly fromStableHasher
. Usingto_le()
in theStableHasher
was breaking this abstraction boundary before slightly.This could be done at compile time, but actually I think that now we can remove this assert altogether.
r? @the8472