oga/benchmark/pull_parser/big_xml_time.rb

12 lines
267 B
Ruby
Raw Normal View History

2014-04-29 12:48:43 +00:00
require_relative '../../lib/oga'
require 'benchmark'
xml = File.read(File.expand_path('../../fixtures/big.xml', __FILE__))
parser = Oga::XML::PullParser.new(xml)
Benchmark.bmbm(10) do |bench|
bench.report '10MB of XML' do
parser.parse { |node| }
end
end