-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[benchmark] Add dataUsingUTF8Encoding() #22648
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
090a8d3
to
0fc4f34
Compare
@palimondo - I've updated as per feedback. Please could someone run CI testing? |
@swift-ci Please smoke test |
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.
Latest changes LGTM
@swift-ci please benchmark |
This comment has been minimized.
This comment has been minimized.
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.
Two more issues I've overlooked before:
- new tests shouldn't use
legacyFactor
- benchmark reports shows there's memory leak, we should wrap that conversion in
autoreleasepool
@milseman @itaiferber Any thoughts on the doubling of memory used between the runs with one and two iterations? Is the use of |
@palimondo This isn't a real leak: the result of So wrapping this call up is entirely reasonable |
Co-Authored-By: ianpartridge <i.partridge@uk.ibm.com>
@palimondo I have updated this PR as requested. Please can someone re-run CI and merge as appropriate? |
@swift-ci please benchmark |
@swift-ci please smoke test |
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 Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
@ianpartridge Thank you for the work on these benchmarks! I'll merge as soon as somebody fixes the failing tests on linux (unrelated to this PR). We can ignore the ⛔️⏱ |
Thanks @palimondo, I hope we can merge soon. |
@swift-ci smoke test linux platform |
@swift-ci please smoke test linux platform |
@milseman The Linux smoke test has been failing the whole weekend. This last one failed few minutes ago. Did somebody fix the CI yet? (it's not even accepting the requests via GitHub without excessive repetition...) |
@swift-ci smoke test linux platform |
Yeah, @gottesmm says he's preparing a fix. Let's wait on that |
Oh, I've notices somebody kicked the CI servers and @swift-ci started to respond again, so I've restarted the smoke test hoping that was all it needed… Sorry for wasting the ⚡️🥺 |
#22692 I believe |
@milseman Can you please ask around why is the Linux smoke test still failing? This is just an addition of a few benchmarks… the failure is clearly unrelated to this PR! I need to get some 💤😴... |
The failure is: |
@swift-ci please clean smoke test linux platform |
OK, we are failing to build benchmarks on Linux with swiftpm: Cross platform Swift sucks! |
@swift-ci please smoke test linux platform with #22707 Edit: Hmm… where are the docs for CI that tell me how to test 2 PR together? Edit2: Aha, it had to be full URL in comment (GitHub shortens it for presentation)! |
For some reason the smoke test with combined PRs didn't work… The error on the console was the same. I guess we'll try again after the #22707 lands? |
@swift-ci please smoke test Linux platform |
Thank you @ianpartridge! |
Currently, `str.data(using:allowLossyConversion)` always bridges via `NSString`. As `String` is now natively UTF8 we can fastpath this conversion in the case where the user requests UTF8 encoding. A benchmark for this was previously added in swiftlang#22648.
Currently, `str.data(using:allowLossyConversion)` always bridges via `NSString`. As `String` is now natively UTF8 we can fastpath this conversion in the case where the user requests UTF8 encoding. A benchmark for this was previously added in #22648.
Currently there is no microbench for
string.data(using: .utf8)
.However, there is a microbench which covers creating a
Data
from aString
viaData(string.utf8)
.It is worth having a separate bench for
string.data(using: .utf8)
because it currently bridges viaNSString
whereasData(string.utf8)
does not.Add a benchmark for
string.data(using: .utf8)
so future improvements to its performance can be measured.CC: @milseman @itaiferber @Catfish-Man