Created
May 9, 2016 23:25
-
-
Save tenderlove/9ea76c0274812b477f32e4a542a97f82 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#$null_stream = $stdout | |
$null_stream = File.open(File::NULL, 'w') | |
require 'rspec' | |
def start_runner | |
RSpec::Core::Runner.run [], $null_stream, $null_stream | |
end | |
tp = TracePoint.new(:inline_cache_hit, :inline_cache_miss) do |x| | |
p x.event | |
end | |
RSpec.send :describe, "foo" do | |
N = (ENV['N'] || 100).to_i.times do |x| | |
it "foo #{x.to_s}" do | |
expect(true).to be | |
end | |
end | |
end | |
#start = Process.clock_gettime Process::CLOCK_MONOTONIC, :microsecond | |
tp.enable | |
start_runner | |
tp.disable | |
#p Process.clock_gettime(Process::CLOCK_MONOTONIC, :microsecond) - start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment