Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ruby/rexml
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.2.8
Choose a base ref
...
head repository: ruby/rexml
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.2.9
Choose a head ref
  • 13 commits
  • 11 files changed
  • 5 contributors

Commits on May 16, 2024

  1. Bump version

    kou committed May 16, 2024
    2 Configuration menu
    Copy the full SHA
    3316f62 View commit details
    Browse the repository at this point in the history

Commits on May 21, 2024

  1. Add support for old strscan

    Fix GH-132
    
    If we support old strscan, users can also use strscan installed as a
    default gem.
    
    Reported by Adam. Thanks!!!
    kou committed May 21, 2024
    Configuration menu
    Copy the full SHA
    f1df7d1 View commit details
    Browse the repository at this point in the history

Commits on May 30, 2024

  1. Use /#{Regexp.escape}/ instead of Regexp.union

    It's for readability.
    kou committed May 30, 2024
    Configuration menu
    Copy the full SHA
    f525ef7 View commit details
    Browse the repository at this point in the history

Commits on May 31, 2024

  1. Fix the NEWS.md and change PR reference that fixes CVE-2024-35176 (#133)

    It seems to me that mentioned in the NEWS.md and in the release notes PR
    #124 ("Move development dependencies to Gemfile") isn't a correct one
    and not related to CVE-2024-35176:
    
    ```
    - Improved parse performance when an attribute has many <s.
      - GH-124
    ```
    
    #126 looks like fixes the issue with attribute value that contains
    multiple '>' characters. At least it adds a proper test.
    andrykonchin authored May 31, 2024
    Configuration menu
    Copy the full SHA
    f59790b View commit details
    Browse the repository at this point in the history

Commits on Jun 2, 2024

  1. Configuration menu
    Copy the full SHA
    4444a04 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3e3893d View commit details
    Browse the repository at this point in the history

Commits on Jun 3, 2024

  1. Optimize Source#read_until method (#135)

    Optimize `Source#read_until` method.
    
    ## 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      9.877       9.992        15.605       17.559 i/s -     100.000 times in 10.124592s 10.008017s 6.408031s 5.695167s
                     sax     22.903      25.151        39.482       50.846 i/s -     100.000 times in 4.366300s 3.975922s 2.532822s 1.966706s
                    pull     25.940      30.474        44.685       61.450 i/s -     100.000 times in 3.855070s 3.281511s 2.237879s 1.627346s
                  stream     25.255      29.500        41.819       53.605 i/s -     100.000 times in 3.959539s 3.389825s 2.391256s 1.865505s
    
    Comparison:
                                  dom
             after(YJIT):        17.6 i/s
            before(YJIT):        15.6 i/s - 1.13x  slower
                   after:        10.0 i/s - 1.76x  slower
                  before:         9.9 i/s - 1.78x  slower
    
                                  sax
             after(YJIT):        50.8 i/s
            before(YJIT):        39.5 i/s - 1.29x  slower
                   after:        25.2 i/s - 2.02x  slower
                  before:        22.9 i/s - 2.22x  slower
    
                                 pull
             after(YJIT):        61.4 i/s
            before(YJIT):        44.7 i/s - 1.38x  slower
                   after:        30.5 i/s - 2.02x  slower
                  before:        25.9 i/s - 2.37x  slower
    
                               stream
             after(YJIT):        53.6 i/s
            before(YJIT):        41.8 i/s - 1.28x  slower
                   after:        29.5 i/s - 1.82x  slower
                  before:        25.3 i/s - 2.12x  slower
    
    ```
    
    - YJIT=ON : 1.13x - 1.38x faster
    - YJIT=OFF : 1.01x - 1.17x faster
    
    Co-authored-by: Sutou Kouhei <kou@clear-code.com>
    naitoh and kou authored Jun 3, 2024
    Configuration menu
    Copy the full SHA
    037c16a View commit details
    Browse the repository at this point in the history
  2. benchmark: Remove non-parsing operations from the DOM case (#136)

    ## Why?
    `.elements.each("root/child") {|_|}` is not a parsing operation.
    
    ## Result
    ```
    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     16.254      16.412        27.189       28.940 i/s -     100.000 times in 6.152343s 6.093050s 3.677924s 3.455456s
                     sax     22.909      23.194        39.481       40.099 i/s -     100.000 times in 4.365165s 4.311414s 2.532840s 2.493807s
                    pull     26.281      25.918        44.465       45.733 i/s -     100.000 times in 3.805063s 3.858328s 2.248968s 2.186621s
                  stream     25.196      25.185        41.674       40.947 i/s -     100.000 times in 3.968828s 3.970585s 2.399554s 2.442158s
    
    Comparison:
                                  dom
             after(YJIT):        28.9 i/s
            before(YJIT):        27.2 i/s - 1.06x  slower
                   after:        16.4 i/s - 1.76x  slower
                  before:        16.3 i/s - 1.78x  slower
    
                                  sax
             after(YJIT):        40.1 i/s
            before(YJIT):        39.5 i/s - 1.02x  slower
                   after:        23.2 i/s - 1.73x  slower
                  before:        22.9 i/s - 1.75x  slower
    
                                 pull
             after(YJIT):        45.7 i/s
            before(YJIT):        44.5 i/s - 1.03x  slower
                  before:        26.3 i/s - 1.74x  slower
                   after:        25.9 i/s - 1.76x  slower
    
                               stream
            before(YJIT):        41.7 i/s
             after(YJIT):        40.9 i/s - 1.02x  slower
                  before:        25.2 i/s - 1.65x  slower
                   after:        25.2 i/s - 1.65x  slower
    
    ```
    
    Co-authored-by: Sutou Kouhei <kou@clear-code.com>
    naitoh and kou authored Jun 3, 2024
    Configuration menu
    Copy the full SHA
    d5ddbff View commit details
    Browse the repository at this point in the history

Commits on Jun 6, 2024

  1. test: improve name

    kou committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    2fc3f79 View commit details
    Browse the repository at this point in the history
  2. test: reduce the number of rehearsal executions

    It reduces test execution time.
    kou committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    da67561 View commit details
    Browse the repository at this point in the history

Commits on Jun 7, 2024

  1. Improve Node#each_recursive performance (#139)

    Fix #134
    
    ## Summary
    
    This PR does:
    
    - Add `benchmark/each_recursive.yaml`
    - Rewrite `Node#each_recursive` implementation for performance
    - Add a test for `Node#each_recursive`
    
    The performance of `Node#each_recursive` is improved 60~80x faster.
    
    ## Details
    
    `each_recursive` is too much slow as I described in #134.
    I improved this performance by rewriting its implementation in this PR.
    
    Also, I added a benchmark in `benchmark/each_recursive.yaml` and the
    following is a result on my laptop:
    
    ```
    RUBYLIB= BUNDLER_ORIG_RUBYLIB= /Users/makenowjust/Projects/github.com/makenowjust/simple-dotfiles/.asdf/installs/ruby/3.3.2/bin/ruby -v -S benchmark-driver /Users/makenowjust/Projects/github.com/ruby/rexml/benchmark/each_recursive.yaml
    ruby 3.3.2 (2024-05-30 revision e5a195edf6) [arm64-darwin23]
    Calculating -------------------------------------
                         rexml 3.2.6      master  3.2.6(YJIT)  master(YJIT)
          each_recursive      11.279     686.502       17.926        1.470k i/s -     100.000 times in 8.866303s 0.145666s 5.578360s 0.068018s
    
    Comparison:
                       each_recursive
            master(YJIT):      1470.2 i/s
                  master:       686.5 i/s - 2.14x  slower
             3.2.6(YJIT):        17.9 i/s - 82.01x  slower
             rexml 3.2.6:        11.3 i/s - 130.35x  slower
    
    ```
    
    We can see that the performance is improved 60~80x faster.
    
    Additionally, I added a new test for `Node#each_recursive`.
    It was missing, but we need it to confirm not to break the previous
    behavior.
    
    Thank you.
    
    ---------
    
    Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
    makenowjust and kou authored Jun 7, 2024
    Configuration menu
    Copy the full SHA
    dab8065 View commit details
    Browse the repository at this point in the history
  2. Improve text parse performance

    If there are many ">"s in text, parsing is very slow.
    
        Calculating -------------------------------------
                             rexml 3.2.6      master  3.2.6(YJIT)  master(YJIT)
                   attribute       1.116      3.618k        1.117        1.941k i/s -      10.000 times in 8.957748s 0.002764s 8.951665s 0.005152s
                        text      27.089      2.262k       42.632        1.033k i/s -      10.000 times in 0.369147s 0.004421s 0.234566s 0.009683s
    
        Comparison:
                                attribute
                      master:      3617.6 i/s
                master(YJIT):      1941.1 i/s - 1.86x  slower
                 3.2.6(YJIT):         1.1 i/s - 3238.31x  slower
                 rexml 3.2.6:         1.1 i/s - 3240.51x  slower
    
                                     text
                      master:      2261.8 i/s
                master(YJIT):      1032.7 i/s - 2.19x  slower
                 3.2.6(YJIT):        42.6 i/s - 53.05x  slower
                 rexml 3.2.6:        27.1 i/s - 83.49x  slower
    kou committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    e06b3fb View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2024

  1. Add 3.2.9 entry

    kou committed Jun 9, 2024
    Configuration menu
    Copy the full SHA
    964c9dc View commit details
    Browse the repository at this point in the history
Loading