You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add fast path for ascii chars to isFirstCodepointUppercase
Whenever we know that the Rope is either using ASCII or something that
is a superset of ASCII (such as UTF-8), we can make a faster check
without needing to extract codepoints and checking for a bigger range
of uppercase characters.
I've used the instructions on
<https://github.com/oracle/truffleruby/blob/master/doc/contributor/profiling.md#require-profiling>
(in combination with a native binary -- `jt build --env native` +
`jt -u native ruby ...`)
to benchmark the impact of this change and the numbers were too close to
the margin of error to tell:
* `master` (without the fix to #2079): avg 57.7ms, median 57ms, p90 64ms
* this commit: avg 57.8ms, median 58ms, p90 63ms
* without fast path (previous commit): avg 56.7ms, median 56ms, p90 63ms
...but since this fast path is both very simple and local to the method,
I think it's worth keeping anyway.
0 commit comments