diff --git a/benchmark/xml/traversal/average_each_node_bench.rb b/benchmark/xml/traversal/average_each_node_bench.rb new file mode 100644 index 0000000..1e2f97f --- /dev/null +++ b/benchmark/xml/traversal/average_each_node_bench.rb @@ -0,0 +1,9 @@ +require_relative '../../benchmark_helper' + +doc = Oga.parse_xml(big_xml_file) + +doc.each_node { } + +measure_average do + doc.each_node { } +end diff --git a/benchmark/xml/traversal/each_node_bench.rb b/benchmark/xml/traversal/each_node_bench.rb new file mode 100644 index 0000000..26a125d --- /dev/null +++ b/benchmark/xml/traversal/each_node_bench.rb @@ -0,0 +1,9 @@ +require_relative '../../benchmark_helper' + +doc = Oga.parse_xml(big_xml_file) + +Benchmark.ips do |bench| + bench.report 'each_node' do + doc.each_node { } + end +end