Skip to content
This repository has been archived by the owner on Oct 8, 2023. It is now read-only.

Commit

Permalink
Include version numbers in benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
seven1m committed Oct 25, 2022
1 parent 43b56bf commit da6dc53
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/benchmark.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@

iterations = 1000

Benchmark.bm(15) do |x|
x.report('RubyParser') { iterations.times { ruby_parser.parse(source) } }
x.report('Parser') { iterations.times { parser.parse(source) } }
x.report('SyntaxTree') { iterations.times { SyntaxTree.parse(source) } }
Benchmark.bm(25) do |x|
x.report("RubyParser #{RubyParserStuff::VERSION}") { iterations.times { ruby_parser.parse(source) } }
x.report("Parser #{Parser::VERSION}") { iterations.times { parser.parse(source) } }
x.report("SyntaxTree #{SyntaxTree::VERSION}") { iterations.times { SyntaxTree.parse(source) } }

# we have to load this here because our Sexp overwrites RubyParser's
# and breaks RubyParser :-(
require 'natalie_parser'
x.report('NatalieParser') { iterations.times { NatalieParser.parse(source) } }
x.report("NatalieParser #{NatalieParser::VERSION}") { iterations.times { NatalieParser.parse(source) } }
end

0 comments on commit da6dc53

Please sign in to comment.