-
Notifications
You must be signed in to change notification settings - Fork 123
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
Branch-less alphanumeric underscore's replacement #1294
base: main
Are you sure you want to change the base?
Conversation
29b76da
to
4d44a72
Compare
I probably have a further suggestion here |
0c78604
to
96c14bd
Compare
I've created this benchmark at which gives these numbers franz1981/java-puzzles@8fb833c with highly predictable sameples:
and with not that much predictable (10K samples):
In both case the I didn't accounted yet for the code duplication, but since native image is not wow to handle |
7fc70d3
to
9a0a872
Compare
Sadly if I got right what C1MaxInlineSize does - C1 doesn't have inlining superpowers, hence reusing code could be relatively costly if the callee is not trivially inlinable, which seems this case |
This is following the same idea of quarkusio/quarkus#45546 re using lookup tables.
If the src
String
s are rarely latin only beyond US_ASCII i.e. [128, 255] this can be further simplified by having a 128-sized lookup table.I didn't yet looked at its performance - and, as suggested at mkouba/qute-benchmarks#1 we should have a proper micro-benchmark which account to stress the branch-predictor too (or not - should be configurable) - unless the non-alphanumeric case is supposed to be very predictable in reality as well