diff options
author | Jean Boussier <[email protected]> | 2024-11-27 10:32:57 +0100 |
---|---|---|
committer | Jean Boussier <[email protected]> | 2024-11-27 14:50:07 +0100 |
commit | 26d020cb6ea98adb38b370cf49b8101292d6f193 (patch) | |
tree | b93424b5f7a000538310340b445b5a27aef7c6be /error.c | |
parent | 43b059b6a3b5c49b7d883c49dd1200580c1f92be (diff) |
Optimize `rb_must_asciicompat`
While profiling `strscan`, I noticed `rb_must_asciicompat` was quite
slow, as more than 5% of the benchmark was spent in it: https://share.firefox.dev/49bOcTn
By checking for the common 3 ASCII compatible encoding index first,
we can skip a lot of expensive operations in the happy path.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/12180
Diffstat (limited to 'error.c')
0 files changed, 0 insertions, 0 deletions