-
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.308 11.437 17.833 18.369 i/s - 100.000 times in 8.843230s 8.743769s 5.607477s 5.443861s sax 31.280 31.835 48.002 51.767 i/s - 100.000 times in 3.196881s 3.141148s 2.083259s 1.931737s pull 36.954 37.981 59.502 62.359 i/s - 100.000 times in 2.706080s 2.632914s 1.680629s 1.603608s stream 34.328 36.263 50.594 56.571 i/s - 100.000 times in 2.913063s 2.757657s 1.976527s 1.767694s Comparison: dom after(YJIT): 18.4 i/s before(YJIT): 17.8 i/s - 1.03x slower after: 11.4 i/s - 1.61x slower before: 11.3 i/s - 1.62x slower sax after(YJIT): 51.8 i/s before(YJIT): 48.0 i/s - 1.08x slower after: 31.8 i/s - 1.63x slower before: 31.3 i/s - 1.65x slower pull after(YJIT): 62.4 i/s before(YJIT): 59.5 i/s - 1.05x slower after: 38.0 i/s - 1.64x slower before: 37.0 i/s - 1.69x slower stream after(YJIT): 56.6 i/s before(YJIT): 50.6 i/s - 1.12x slower after: 36.3 i/s - 1.56x slower before: 34.3 i/s - 1.65x slower ``` - YJIT=ON : 1.03x - 1.12x faster - YJIT=OFF : 1.01x - 1.05x faster
- Loading branch information
Showing
2 changed files
with
96 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