-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Memoize the ObjCBridgeable conformance for Swift.String #30329
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
This seems to be the single most common bridge cast, and repeated lookup seems to be a performance issue for the common operation of bridging a string-valued NSDictionary into Swift. Spending a couple of static words of memory to memoize it should be a nice perf win.
|
@swift-ci Please 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 |
|
@Catfish-Man -- Any thoughts about |
|
FlattenListFlatMap has been odder than one might expect; I've been looking into it for the array changes I've been working on, and it doesn't respond to changes in a way I can make sense of. I wouldn't worry about it too much but taking a quick sample/instruments profile locally might be worthwhile just in case. |
|
@swift-ci Please 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 |
Depending on benchmark results, this may get backed out.
|
@swift-ci Please 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 |
|
@Catfish-Man -- Thoughts? Given the lack of interesting difference between these benchmarks, I'm inclined to back out the last change (caching Dictionary and Array conformances) and just keep the String conformance cache. |
This reverts commit 2b93747.
|
@swift-ci Please test |
|
Build failed |
|
Build failed |
This seems to be the single most common bridge cast,
and repeated lookup seems to be a performance issue
for the common operation of bridging a string-valued
NSDictionary into Swift. Spending a couple of static
words of memory to memoize it could be a nice perf win.
Resolves rdar://55237013