Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize BaseParser#unnormalize method
## Benchmark ``` RUBYLIB= BUNDLER_ORIG_RUBYLIB= /Users/naitoh/.rbenv/versions/3.3.3/bin/ruby -v -S benchmark-driver /Users/naitoh/ghq/github.com/naitoh/rexml/benchmark/parse.yaml ruby 3.3.3 (2024-06-12 revision f1c7b6f435) [arm64-darwin22] Calculating ------------------------------------- before after before(YJIT) after(YJIT) dom 17.628 17.649 33.498 32.620 i/s - 100.000 times in 5.672656s 5.666057s 2.985297s 3.065603s sax 25.255 25.388 48.751 48.927 i/s - 100.000 times in 3.959536s 3.938845s 2.051240s 2.043874s pull 29.061 29.050 61.483 61.910 i/s - 100.000 times in 3.441025s 3.442284s 1.626476s 1.615253s stream 28.401 29.467 55.235 60.095 i/s - 100.000 times in 3.520992s 3.393656s 1.810444s 1.664032s Comparison: dom before(YJIT): 33.5 i/s after(YJIT): 32.6 i/s - 1.03x slower after: 17.6 i/s - 1.90x slower before: 17.6 i/s - 1.90x slower sax after(YJIT): 48.9 i/s before(YJIT): 48.8 i/s - 1.00x slower after: 25.4 i/s - 1.93x slower before: 25.3 i/s - 1.94x slower pull after(YJIT): 61.9 i/s before(YJIT): 61.5 i/s - 1.01x slower before: 29.1 i/s - 2.13x slower after: 29.1 i/s - 2.13x slower stream after(YJIT): 60.1 i/s before(YJIT): 55.2 i/s - 1.09x slower after: 29.5 i/s - 2.04x slower before: 28.4 i/s - 2.12x slower ``` - YJIT=ON : 0.97x - 1.09x faster - YJIT=OFF : 0.99x - 1.03x faster
- Loading branch information