-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
3 changed files
with
52 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
loop_count: 10 | ||
contexts: | ||
- gems: | ||
rexml: 3.2.6 | ||
require: false | ||
prelude: require "rexml" | ||
- name: master | ||
prelude: | | ||
$LOAD_PATH.unshift(File.expand_path("lib")) | ||
require "rexml" | ||
- name: 3.2.6(YJIT) | ||
gems: | ||
rexml: 3.2.6 | ||
require: false | ||
prelude: | | ||
require "rexml" | ||
RubyVM::YJIT.enable | ||
- name: master(YJIT) | ||
prelude: | | ||
$LOAD_PATH.unshift(File.expand_path("lib")) | ||
require "rexml" | ||
RubyVM::YJIT.enable | ||
prelude: | | ||
require "rexml/document" | ||
n = 10000 | ||
gts = ">" * n | ||
in_attribute = "<test attribute=\"#{gts}\"></test>" | ||
in_text = "<test>#{gts}</test>" | ||
benchmark: | ||
"attribute": REXML::Document.new(in_attribute) | ||
"text": REXML::Document.new(in_text) |
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