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
In get_partial_safe, it's possible to use aligned loads by declaring the buffer as MaybeUninit<State> and then casting the pointer for std::ptr::copy and zeroing the rest of the buffer, instead of declaring the buffer as an u8 array.
From what I can see there is a compiler optimization that stack allocates [0i8; VECTOR_SIZE] instead of heap allocating (probably because VECTOR_SIZE is a constant), so MaybeUninit<State> may not be faster.
I tried using a struct which contains only the byte array and is marked as #[repr(align(16))]. I have not tested the performance yet, but this should still allocate on the stack and force 16-byte alignment.
In get_partial_safe, it's possible to use aligned loads by declaring the buffer as
MaybeUninit<State>
and then casting the pointer for std::ptr::copy and zeroing the rest of the buffer, instead of declaring the buffer as an u8 array.gxhash/src/gxhash/platform/x86_128.rs
Lines 35 to 39 in b2b9d24
The text was updated successfully, but these errors were encountered: