Skip to content

Instantly share code, notes, and snippets.

@pgeraghty
Created March 10, 2014 17:35
Show Gist options
  • Save pgeraghty/9469912 to your computer and use it in GitHub Desktop.
Save pgeraghty/9469912 to your computer and use it in GitHub Desktop.
Benchmark require load time and memory usage
require 'benchmark'
def require(file)
puts `pmap #{Process.pid} | grep 'total'`
puts Benchmark.measure('') { super }.format("%t require #{file}")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment