-
Notifications
You must be signed in to change notification settings - Fork 53
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.358 11.374 17.536 18.093 i/s - 100.000 times in 8.804278s 8.791918s 5.702682s 5.527141s sax 31.874 31.540 48.258 51.511 i/s - 100.000 times in 3.137347s 3.170623s 2.072180s 1.941332s pull 37.241 37.333 57.231 62.840 i/s - 100.000 times in 2.685216s 2.678569s 1.747292s 1.591331s stream 34.810 34.611 49.782 52.469 i/s - 100.000 times in 2.872769s 2.889233s 2.008770s 1.905875s Comparison: dom after(YJIT): 18.1 i/s before(YJIT): 17.5 i/s - 1.03x slower after: 11.4 i/s - 1.59x slower before: 11.4 i/s - 1.59x slower sax after(YJIT): 51.5 i/s before(YJIT): 48.3 i/s - 1.07x slower before: 31.9 i/s - 1.62x slower after: 31.5 i/s - 1.63x slower pull after(YJIT): 62.8 i/s before(YJIT): 57.2 i/s - 1.10x slower after: 37.3 i/s - 1.68x slower before: 37.2 i/s - 1.69x slower stream after(YJIT): 52.5 i/s before(YJIT): 49.8 i/s - 1.05x slower before: 34.8 i/s - 1.51x slower after: 34.6 i/s - 1.52x slower ``` - YJIT=ON : 1.03x - 1.10x faster - YJIT=OFF : 0.99x - 1.00x faster
- Loading branch information
Showing
2 changed files
with
108 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