require_relative '../benchmark_helper' simple = '
Hello world
' attributes = 'Hello world
' nested = 'Helloworld
' Benchmark.ips do |bench| bench.report 'text only' do Oga::XML::Parser.new(simple).parse end bench.report 'text + attributes' do Oga::XML::Parser.new(attributes).parse end bench.report 'text + children' do Oga::XML::Parser.new(nested).parse end end