-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Cache the default malloc zone #29978
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
@swift-ci please smoke test |
@swift-ci please smoke benchmark |
Performance: -O
Code size: -OPerformance: -Osize
Code size: -OsizePerformance: -Onone
Code size: -swiftlibsHow 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 Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
Looks like with fast dealloc disabled the win is below the 7% threshold to be reported, so we just get noise. Disturbing to see (?) on a 36% change though. |
@@ -57,6 +61,13 @@ using namespace swift; | |||
static_assert(_swift_MinAllocationAlignment > MALLOC_ALIGN_MASK, | |||
"Swift's default alignment must exceed platform malloc mask."); | |||
|
|||
#if defined(__APPLE__) | |||
static inline malloc_zone_t *DEFAULT_ZONE() { | |||
static malloc_zone_t *z = SWIFT_LAZY_CONSTANT(malloc_default_zone()); |
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.
The static
and SWIFT_LAZY_CONSTANT
create two levels of lazy initialization; we only need one of them IIUC.
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.
Good catch! This shouldn't have the static
.
I measured a 7% win on FilterEvenUsingReduceInto with fast dealloc enabled (which it won't be in CI)