diff options
| author | Sharon Rosner <sharon@noteflakes.com> | 2025-10-12 00:35:54 +0200 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2025-10-11 22:36:21 +0000 |
| commit | fa54a9c9e58fa810ccef9eef86dd7ba8f1763f2d (patch) | |
| tree | 711d51a34dc5552ced8fd811096b9e325f441393 /ruby-runner.c | |
| parent | 89dc79eeba9b450d2cc921b428fd4519f5e04690 (diff) | |
[ruby/erb] html_escape: Avoid buffer allocation for strings with no
escapable character
(https://github.com/ruby/erb/pull/87)
This change improves reduces allocations and makes `html_escape` ~35% faster in
a benchmark with escaped strings taken from the `test_html_escape` test in
`test/test_erb.rb`.
- Perform buffer allocation on first instance of escapable character.
- Instead of copying characters one at a time, copy unescaped segments using
`memcpy`.
https://github.com/ruby/erb/commit/aa482890fe
Diffstat (limited to 'ruby-runner.c')
0 files changed, 0 insertions, 0 deletions
