Skip to content

Instantly share code, notes, and snippets.

@Mehonoshin
Created December 13, 2017 10:12
Show Gist options
  • Save Mehonoshin/9c22d3187815aee03c391bfb2d1e892a to your computer and use it in GitHub Desktop.
Save Mehonoshin/9c22d3187815aee03c391bfb2d1e892a to your computer and use it in GitHub Desktop.
Checking how long each gem from Gemfile takes to load
require "benchmark"
if ENV['TRACE_GEMS']
def require(file_name)
result = nil
time = Benchmark.realtime do
result = super
end
if time > 0.1
puts "#{time} #{file_name}"
end
result
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment