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
Revert "argon2: align blocks to 128-byte boundaries for modern x86-64 and aarch64"
This reverts commit 1342037.
For reasons not yet understood, aligning blocks to 128-byte boundaries
results in worse performance than using 64-byte alignment.
Looking into this with perf suggests that it is *not* a cache problem,
but rather that the generated code is different and results in
substantially more instructions being executed when the blocks are
128-byte aligned.
For now, revert the alignment back to 64 bytes. While we're at it, also
remove the comment that suggests alignment is only needed to prevent
false sharing: it's possible that other places in the crate, which I
haven't checked, required (for correctness or best performance) the
64-byte alignment we're reverting back to.
It's worth noting that false sharing isn't generally a major issue in
Argon2: due to how memory is accessed, only the first and last few words
of a segment can (and most of the time probably still won't) experience
some false sharing with reads from other lanes.
Finally, changing the alignment with 1342037 would have a major
SemVer change:
https://doc.rust-lang.org/cargo/reference/semver.html#repr-align-n-change
0 commit comments