From 70fcc8534c5bac946957548362f71da2cc97c342 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Tue, 29 Apr 2014 13:05:45 +0200 Subject: [PATCH] Benchmark for parsing big XML documents. --- benchmark/parser/bench_big_xml_time.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 benchmark/parser/bench_big_xml_time.rb diff --git a/benchmark/parser/bench_big_xml_time.rb b/benchmark/parser/bench_big_xml_time.rb new file mode 100644 index 0000000..d1534ab --- /dev/null +++ b/benchmark/parser/bench_big_xml_time.rb @@ -0,0 +1,11 @@ +require_relative '../../lib/oga' +require 'benchmark' + +xml = File.read(File.expand_path('../../fixtures/big.xml', __FILE__)) +parser = Oga::XML::Parser.new(xml) + +Benchmark.bmbm(10) do |bench| + bench.report '11MB of XML' do + parser.parse + end +end