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.776 17.551 32.512 32.658 i/s - 100.000 times in 5.625671s 5.697584s 3.075829s 3.062028s sax 25.326 25.243 50.344 50.082 i/s - 100.000 times in 3.948501s 3.961519s 1.986315s 1.996706s pull 29.015 29.066 61.714 61.798 i/s - 100.000 times in 3.446473s 3.440471s 1.620377s 1.618183s stream 28.201 29.706 55.646 59.422 i/s - 100.000 times in 3.545943s 3.366298s 1.797077s 1.682876s Comparison: dom after(YJIT): 32.7 i/s before(YJIT): 32.5 i/s - 1.00x slower before: 17.8 i/s - 1.84x slower after: 17.6 i/s - 1.86x slower sax before(YJIT): 50.3 i/s after(YJIT): 50.1 i/s - 1.01x slower before: 25.3 i/s - 1.99x slower after: 25.2 i/s - 1.99x slower pull after(YJIT): 61.8 i/s before(YJIT): 61.7 i/s - 1.00x slower after: 29.1 i/s - 2.13x slower before: 29.0 i/s - 2.13x slower stream after(YJIT): 59.4 i/s before(YJIT): 55.6 i/s - 1.07x slower after: 29.7 i/s - 2.00x slower before: 28.2 i/s - 2.11x slower ``` - YJIT=ON : 0.99x - 1.07x faster - YJIT=OFF : 0.98x - 1.05x faster
- Loading branch information