-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[stdlib] Comparison benchmarks for String #13217
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
# Conflicts: # benchmark/single-source/StringComparison.swift
@swift-ci please benchmark |
Build comment file:Optimized (O)Regression (8)
Improvement (30)
No Changes (296)
Added (8)
Unoptimized (Onone)Regression (8)
Improvement (9)
No Changes (317)
Added (8)
Hardware Overview
|
@swift-ci please smoke test and merge |
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.
👍
Could you also have a workload or two that has shared long, common prefixes? E.g. comparison between two long URLs on the same domain, etc.
for s1 in payload { | ||
for s2 in payload { | ||
let cmp = s1 < s2 | ||
count += cmp ? 1 : 0 |
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.
These days, the benchmark suite has a blackHole
function (inline never in another module) that you can also feed results into. That's an additional guarantee that the entire benchmark won't be trivialized by a better optimizer. (This is why many benchmarks followed the pattern of an inline(never) helper that returned a result derived from the inner loop, though that wasn't always perfect and blackHole
is better).
Adds a few benchmarks for string comparisons. This is in preparation for the revamped string comparison and will give us a look at the before/after