diff options
| author | Takashi Kokubun <takashikkbn@gmail.com> | 2022-11-04 23:58:43 -0700 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2022-11-05 06:58:48 +0000 |
| commit | 419d2fc14d2bedc6d5a7080ee80df8330884ea6c (patch) | |
| tree | 842d7950bac3f9e68baf299434141ca02674b808 /ruby_assert.h | |
| parent | f276d5a7fe28ae4fd2934af4befd920bb78cfa9e (diff) | |
[ruby/erb] Optimize the no-escape case with strpbrk
(https://github.com/ruby/erb/pull/29)
Typically, strpbrk(3) is optimized pretty well with SIMD instructions.
Just using it makes this as fast as a SIMD-based implementation for the
no-escape case.
Not utilizing this for escaped cases because memory allocation would be
a more significant bottleneck for many strings anyway. Also, there'll be
some overhead in calling a C function (strpbrk) many times because we're
not using SIMD instructions directly. So using strpbrk all the time
might not necessarily be faster.
Diffstat (limited to 'ruby_assert.h')
0 files changed, 0 insertions, 0 deletions
