diff options
| author | Aaron Patterson <tenderlove@ruby-lang.org> | 2024-02-13 08:20:27 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-13 16:20:27 +0000 |
| commit | c35fea8509551aefe257986c937ea7147f436bdf (patch) | |
| tree | 1c7cfb948db049aedffa0305e25e14d56d21f314 /internal | |
| parent | a71d1ed83875600c174e66a8ace18e0ad451958a (diff) | |
Specialize String#byteslice(a, b) (#9939)
* Specialize String#byteslice(a, b)
This adds a specialization for String#byteslice when there are two
parameters.
This makes our protobuf parser go from 5.84x slower to 5.33x slower
```
Comparison:
decode upstream (53738 bytes): 7228.5 i/s
decode protobuff (53738 bytes): 1236.8 i/s - 5.84x slower
Comparison:
decode upstream (53738 bytes): 7024.8 i/s
decode protobuff (53738 bytes): 1318.5 i/s - 5.33x slower
```
* Update yjit/src/codegen.rs
---------
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/string.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/internal/string.h b/internal/string.h index ba2af25877..cde81a1a25 100644 --- a/internal/string.h +++ b/internal/string.h @@ -45,6 +45,7 @@ void rb_str_make_independent(VALUE str); int rb_enc_str_coderange_scan(VALUE str, rb_encoding *enc); int rb_ascii8bit_appendable_encoding_index(rb_encoding *enc, unsigned int code); VALUE rb_str_include(VALUE str, VALUE arg); +VALUE rb_str_byte_substr(VALUE str, VALUE beg, VALUE len); static inline bool STR_EMBED_P(VALUE str); static inline bool STR_SHARED_P(VALUE str); |
