Commit 62c44a9
committed
Improve comment parse performance
## 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 938.694 3.947k 875.350 2.853k i/s - 100.000 times in 0.106531s 0.025336s 0.114240s 0.035046s
in_doctype 988.445 3.896k 926.836 2.860k i/s - 100.000 times in 0.101169s 0.025670s 0.107894s 0.034963s
after_doctype 610.627 1.223k 546.379 1.049k i/s - 100.000 times in 0.163766s 0.081783s 0.183023s 0.095290s
Comparison:
top_level
master: 3947.0 i/s
master(YJIT): 2853.4 i/s - 1.38x slower
rexml 3.4.1: 938.7 i/s - 4.20x slower
3.4.1(YJIT): 875.4 i/s - 4.51x slower
in_doctype
master: 3895.6 i/s
master(YJIT): 2860.2 i/s - 1.36x slower
rexml 3.4.1: 988.4 i/s - 3.94x slower
3.4.1(YJIT): 926.8 i/s - 4.20x slower
after_doctype
master: 1222.7 i/s
master(YJIT): 1049.4 i/s - 1.17x slower
rexml 3.4.1: 610.6 i/s - 2.00x slower
3.4.1(YJIT): 546.4 i/s - 2.24x slower
```
- YJIT=ON : 1.91x - 3.25x faster
- YJIT=OFF : 2.00x - 4.20x faster1 parent 64a709e commit 62c44a9
File tree
3 files changed
+77
-27
lines changed- benchmark
- lib/rexml/parsers
- test/parse
3 files changed
+77
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
| 280 | + | |
288 | 281 | | |
289 | 282 | | |
290 | 283 | | |
| |||
417 | 410 | | |
418 | 411 | | |
419 | 412 | | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
| 413 | + | |
| 414 | + | |
426 | 415 | | |
427 | 416 | | |
428 | 417 | | |
| |||
463 | 452 | | |
464 | 453 | | |
465 | 454 | | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
| 455 | + | |
| 456 | + | |
474 | 457 | | |
475 | 458 | | |
476 | 459 | | |
| |||
738 | 721 | | |
739 | 722 | | |
740 | 723 | | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
741 | 736 | | |
742 | 737 | | |
743 | 738 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
51 | 63 | | |
52 | 64 | | |
53 | 65 | | |
| |||
72 | 84 | | |
73 | 85 | | |
74 | 86 | | |
75 | | - | |
| 87 | + | |
76 | 88 | | |
77 | 89 | | |
78 | 90 | | |
79 | | - | |
80 | | - | |
| 91 | + | |
| 92 | + | |
81 | 93 | | |
82 | 94 | | |
83 | 95 | | |
84 | | - | |
85 | 96 | | |
86 | 97 | | |
87 | 98 | | |
| |||
0 commit comments