-
Notifications
You must be signed in to change notification settings - Fork 10.5k
🚱[DNM][stdlib] Finalize Hasher layout by adding 256 bits of extra state #20185
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
C.f. #20180 |
@swift-ci please benchmark |
@swift-ci please test |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
stdlib/public/core/SipHash.swift
Outdated
private var _state: _SipHashState | ||
|
||
@inline(__always) | ||
@usableFromInline | ||
@_effects(releasenone) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gah, these should've remained force-inlined...
Let's run a control benchmark without the padding. This should have minimal/no regressions from master. @swift-ci benchmark |
@swift-ci smoke test |
This comment has been minimized.
This comment has been minimized.
Those code size increases... 🤔 |
These accidentally lost their @inline(__always) attributes during the reshuffle.
493a634
to
297c82d
Compare
@swift-ci benchmark |
It looks like eliminating the I spun off #20198 to isolate this. |
Build comment file:Performance: -O
Code size: -O
Performance: -Osize
Code size: -Osize
Performance: -Onone
Code size: Swift libraries
How to read the dataThe tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.If you see any unexpected regressions, you should consider fixing the regressions before you merge the PR. Noise: Sometimes the performance results (not code size!) contain false alarms. Unexpected regressions which are marked with '(?)' are probably noise. If you see regressions which you cannot explain you can try to run the benchmarks again. If regressions still show up, please consult with the performance team (@eeckstein). Hardware Overview
|
@swift-ci please benchmark |
Build comment file:Performance: -O
Code size: -O
Performance: -Osize
Code size: -Osize
Performance: -Onone
How to read the dataThe tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.If you see any unexpected regressions, you should consider fixing the regressions before you merge the PR. Noise: Sometimes the performance results (not code size!) contain false alarms. Unexpected regressions which are marked with '(?)' are probably noise. If you see regressions which you cannot explain you can try to run the benchmarks again. If regressions still show up, please consult with the performance team (@eeckstein). Hardware Overview
|
Closing. The last remaining piece of this is #20198. |
It seems too costly to make Hasher a resilient struct, so leave it
@_fixed_layout
.To partially compensate for this, add 256 bits of extra state space, reserved for potential future use.