Skip to content

Commit 4bb28e4

Browse files
committed
Add parse.rb for profiling
1 parent 71a568c commit 4bb28e4

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

parse.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# require "bundler/setup"
2+
3+
require 'rbs'
4+
# require 'benchmark/ips'
5+
6+
if (opt = ARGV[0]) == "--wait"
7+
ARGV.shift
8+
puts "⏯️ Waiting for enter to continue at #{Process.pid}..."
9+
STDIN.gets
10+
end
11+
12+
file = ARGV.shift
13+
sig = File.read(file)
14+
15+
puts "#{file} -- #{sig.bytesize} bytes"
16+
17+
started_at = Time.now
18+
secs = 3
19+
20+
loop do
21+
RBS::Parser.parse_signature(sig)
22+
break if (Time.now - started_at) > secs
23+
end

0 commit comments

Comments
 (0)