-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed processing in REXML::Parsers::BaseParser#pull_event from regu…
…lar expression to processing using StringScanner. ## Why Improve maintainability by optimizing the process so that the parsing process proceeds using StringScanner#scan. # Changed - Added read_source option to IOSource#match to suppress read from @source. - Added Source#string= method for error message output. ## Benchmark ``` RUBYLIB= BUNDLER_ORIG_RUBYLIB= /Users/naitoh/.rbenv/versions/3.3.0/bin/ruby -v -S benchmark-driver /Users/naitoh/ghq/github.com/naitoh/rexml/benchmark/parse.yaml ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin22] Calculating ------------------------------------- before after before(YJIT) after(YJIT) dom 11.212 11.265 16.790 17.516 i/s - 100.000 times in 8.918888s 8.877029s 5.956020s 5.708918s sax 31.104 31.316 48.855 51.176 i/s - 100.000 times in 3.214996s 3.193254s 2.046874s 1.954042s pull 36.383 36.825 58.219 61.877 i/s - 100.000 times in 2.748537s 2.715521s 1.717648s 1.616122s stream 34.269 34.250 49.734 52.409 i/s - 100.000 times in 2.918062s 2.919715s 2.010702s 1.908054s Comparison: dom after(YJIT): 17.5 i/s before(YJIT): 16.8 i/s - 1.04x slower after: 11.3 i/s - 1.55x slower before: 11.2 i/s - 1.56x slower sax after(YJIT): 51.2 i/s before(YJIT): 48.9 i/s - 1.05x slower after: 31.3 i/s - 1.63x slower before: 31.1 i/s - 1.65x slower pull after(YJIT): 61.9 i/s before(YJIT): 58.2 i/s - 1.06x slower after: 36.8 i/s - 1.68x slower before: 36.4 i/s - 1.70x slower stream after(YJIT): 52.4 i/s before(YJIT): 49.7 i/s - 1.05x slower before: 34.3 i/s - 1.53x slower after: 34.2 i/s - 1.53x slower ``` - YJIT=ON : 1.04x - 1.05x faster - YJIT=OFF : 1.00x - 1.01x faster
- Loading branch information
Showing
2 changed files
with
106 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters