Skip to content

Instantly share code, notes, and snippets.

@wesgarrison
Created March 14, 2011 14:49
Show Gist options
  • Save wesgarrison/869238 to your computer and use it in GitHub Desktop.
Save wesgarrison/869238 to your computer and use it in GitHub Desktop.
spec_helper.rb
# From http://opinionated-programmer.com/2011/02/profiling-spork-for-faster-start-up-time/
Spork.prefork do
# ... your normal prefork block goes here ...
module Kernel
def require_with_trace(*args)
start = Time.now.to_f
@indent ||= 0
@indent += 2
require_without_trace(*args)
@indent -= 2
Kernel::puts "#{' '*@indent}#{((Time.now.to_f - start)*1000).to_i} #{args[0]}"
end
alias_method_chain :require, :trace
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment