-
Notifications
You must be signed in to change notification settings - Fork 50
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.289 11.358 17.714 17.949 i/s - 100.000 times in 8.858505s 8.804219s 5.645189s 5.571484s sax 31.403 31.528 49.524 51.521 i/s - 100.000 times in 3.184448s 3.171815s 2.019218s 1.940954s pull 36.580 36.984 58.444 60.713 i/s - 100.000 times in 2.733724s 2.703908s 1.711054s 1.647084s stream 34.225 34.187 49.746 50.839 i/s - 100.000 times in 2.921876s 2.925118s 2.010215s 1.966987s Comparison: dom after(YJIT): 17.9 i/s before(YJIT): 17.7 i/s - 1.01x slower after: 11.4 i/s - 1.58x slower before: 11.3 i/s - 1.59x slower sax after(YJIT): 51.5 i/s before(YJIT): 49.5 i/s - 1.04x slower after: 31.5 i/s - 1.63x slower before: 31.4 i/s - 1.64x slower pull after(YJIT): 60.7 i/s before(YJIT): 58.4 i/s - 1.04x slower after: 37.0 i/s - 1.64x slower before: 36.6 i/s - 1.66x slower stream after(YJIT): 50.8 i/s before(YJIT): 49.7 i/s - 1.02x slower before: 34.2 i/s - 1.49x slower after: 34.2 i/s - 1.49x slower ``` - YJIT=ON : 1.01x - 1.04x faster - YJIT=OFF : 1.00x - 1.01x faster
- Loading branch information
Showing
2 changed files
with
105 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