File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed
Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -13,3 +13,4 @@ group :memcheck do
1313end
1414gem "rbs" , platform : %i[ mri mswin mingw x64_mingw ]
1515gem "parser"
16+ gem "benchmark-ips"
Original file line number Diff line number Diff line change 88 specs:
99 abbrev (0.1.2 )
1010 ast (2.4.2 )
11+ benchmark-ips (2.13.0 )
1112 ffi (1.16.3 )
1213 mini_portile2 (2.8.5 )
1314 nokogiri (1.16.0 )
@@ -35,6 +36,7 @@ PLATFORMS
3536 universal-java-20
3637
3738DEPENDENCIES
39+ benchmark-ips
3840 ffi
3941 parser
4042 prism !
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env ruby
2+ # frozen_string_literal: true
3+
4+ require "bundler/setup"
5+ require "benchmark/ips"
6+ require "parser/current"
7+ require "prism"
8+
9+
10+ filepath = ARGV . fetch ( 0 ) { File . expand_path ( "../lib/prism/translation/parser/compiler.rb" , __dir__ ) }
11+
12+ Benchmark . ips do |x |
13+ x . report ( "Parser::CurrentRuby" ) { Parser ::CurrentRuby . parse_file ( filepath ) }
14+ x . report ( "Parser::Prism" ) { Prism . parse_file ( filepath ) }
15+ x . report ( "Prism::Translation::Parser" ) { Prism ::Translation ::Parser . parse_file ( filepath ) }
16+ x . compare!
17+ end
You can’t perform that action at this time.
0 commit comments