Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve comment parse performance #245

Merged
merged 1 commit into from
Mar 3, 2025

Conversation

naitoh
Copy link
Contributor

@naitoh naitoh commented Mar 2, 2025

Benchmark (Comparison with rexml 3.4.1)

$ benchmark-driver benchmark/parse_comment.yaml
Calculating -------------------------------------
                     rexml 3.4.1      master  3.4.1(YJIT)  master(YJIT)
           top_level     999.440      5.058k      922.416        3.340k i/s -     100.000 times in 0.100056s 0.019770s 0.108411s 0.029936s
          in_doctype      1.063k      4.890k      980.498        3.341k i/s -     100.000 times in 0.094116s 0.020449s 0.101989s 0.029927s
       after_doctype     638.321      1.304k      603.952        1.153k i/s -     100.000 times in 0.156661s 0.076710s 0.165576s 0.086748s

Comparison:
                        top_level
              master:      5058.2 i/s
        master(YJIT):      3340.5 i/s - 1.51x  slower
         rexml 3.4.1:       999.4 i/s - 5.06x  slower
         3.4.1(YJIT):       922.4 i/s - 5.48x  slower

                       in_doctype
              master:      4890.2 i/s
        master(YJIT):      3341.5 i/s - 1.46x  slower
         rexml 3.4.1:      1062.5 i/s - 4.60x  slower
         3.4.1(YJIT):       980.5 i/s - 4.99x  slower

                    after_doctype
              master:      1303.6 i/s
        master(YJIT):      1152.8 i/s - 1.13x  slower
         rexml 3.4.1:       638.3 i/s - 2.04x  slower
         3.4.1(YJIT):       604.0 i/s - 2.16x  slower
  • YJIT=ON : 1.90x - 3.62x faster
  • YJIT=OFF : 2.04x - 5.06x faster

@naitoh naitoh marked this pull request as ready for review March 2, 2025 10:06
@naitoh naitoh requested a review from kou March 2, 2025 10:06
@naitoh naitoh force-pushed the improve_comment_parse_performance branch 3 times, most recently from f89826b to 62c44a9 Compare March 3, 2025 03:48
@naitoh naitoh requested a review from kou March 3, 2025 03:52
## Benchmark (Comparison with rexml 3.4.1)
```
$ benchmark-driver benchmark/parse_comment.yaml
Calculating -------------------------------------
                     rexml 3.4.1      master  3.4.1(YJIT)  master(YJIT)
           top_level     999.440      5.058k      922.416        3.340k i/s -     100.000 times in 0.100056s 0.019770s 0.108411s 0.029936s
          in_doctype      1.063k      4.890k      980.498        3.341k i/s -     100.000 times in 0.094116s 0.020449s 0.101989s 0.029927s
       after_doctype     638.321      1.304k      603.952        1.153k i/s -     100.000 times in 0.156661s 0.076710s 0.165576s 0.086748s

Comparison:
                        top_level
              master:      5058.2 i/s
        master(YJIT):      3340.5 i/s - 1.51x  slower
         rexml 3.4.1:       999.4 i/s - 5.06x  slower
         3.4.1(YJIT):       922.4 i/s - 5.48x  slower

                       in_doctype
              master:      4890.2 i/s
        master(YJIT):      3341.5 i/s - 1.46x  slower
         rexml 3.4.1:      1062.5 i/s - 4.60x  slower
         3.4.1(YJIT):       980.5 i/s - 4.99x  slower

                    after_doctype
              master:      1303.6 i/s
        master(YJIT):      1152.8 i/s - 1.13x  slower
         rexml 3.4.1:       638.3 i/s - 2.04x  slower
         3.4.1(YJIT):       604.0 i/s - 2.16x  slower
```

- YJIT=ON : 1.90x - 3.62x faster
- YJIT=OFF : 2.04x - 5.06x faster
@naitoh naitoh force-pushed the improve_comment_parse_performance branch from 62c44a9 to b16d62e Compare March 3, 2025 04:28
@naitoh naitoh requested a review from kou March 3, 2025 04:35
@kou kou merged commit 4349091 into ruby:master Mar 3, 2025
67 checks passed
@naitoh naitoh deleted the improve_comment_parse_performance branch March 3, 2025 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants