summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2024-09-03 09:38:18 +0200
committerJean Boussier <jean.boussier@gmail.com>2024-09-03 12:21:36 +0200
commitb7fa2dd0d0b7328f8f713b7cf0332d1e34c20fe4 (patch)
treea4ac16a74fbe895602302b3950efaaa8db4464ed /test/ruby
parent245ed2fc890f7f33526e1c0f42b79c30366493e6 (diff)
rb_enc_str_asciionly_p: avoid always fetching the encoding
Profiling of `JSON.dump` shows a significant amount of time spent in `rb_enc_str_asciionly_p`, in large part because it fetches the encoding. It can be made twice as fast in this scenario by first checking the coderange and only falling back to fetching the encoding if the coderange is unknown. Additionally we can skip fetching the encoding for the common popular encodings.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11533
Diffstat (limited to 'test/ruby')
0 files changed, 0 insertions, 0 deletions