Removed two useless XML lexer benchmarks.
This commit is contained in:
		
							parent
							
								
									c69d77109b
								
							
						
					
					
						commit
						8bab5c70d8
					
				| 
						 | 
					@ -1,20 +0,0 @@
 | 
				
			||||||
require_relative '../../benchmark_helper'
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
string = 'Hello, how are you doing today?'
 | 
					 | 
				
			||||||
small  = "<![CDATA[#{string}]]>"
 | 
					 | 
				
			||||||
medium = "<![CDATA[#{string * 1_000}]]>"
 | 
					 | 
				
			||||||
large  = "<![CDATA[#{string * 10_000}]]>"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Benchmark.ips do |bench|
 | 
					 | 
				
			||||||
  bench.report 'CDATA with a small body' do
 | 
					 | 
				
			||||||
    Oga::XML::Lexer.new(small).lex
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  bench.report 'CDATA with a medium body' do
 | 
					 | 
				
			||||||
    Oga::XML::Lexer.new(medium).lex
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  bench.report 'CDATA with a large body' do
 | 
					 | 
				
			||||||
    Oga::XML::Lexer.new(large).lex
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,19 +0,0 @@
 | 
				
			||||||
require_relative '../../benchmark_helper'
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
simple     = '<p>Hello world</p>'
 | 
					 | 
				
			||||||
attributes = '<p class="foo">Hello world</p>'
 | 
					 | 
				
			||||||
nested     = '<p>Hello<strong>world</strong></p>'
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Benchmark.ips do |bench|
 | 
					 | 
				
			||||||
  bench.report 'text only' do
 | 
					 | 
				
			||||||
    Oga::XML::Lexer.new(simple).lex
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  bench.report 'text + attributes' do
 | 
					 | 
				
			||||||
    Oga::XML::Lexer.new(attributes).lex
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  bench.report 'text + children' do
 | 
					 | 
				
			||||||
    Oga::XML::Lexer.new(nested).lex
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
		Loading…
	
		Reference in New Issue