mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1261 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
15 lines
341 B
Ruby
15 lines
341 B
Ruby
# No GC nonsense.
|
|
GC.disable
|
|
|
|
# Try to load the ruby-prof extension; fail back to the pure-Ruby
|
|
# profiler included in the standard library.
|
|
begin
|
|
require 'prof'
|
|
Prof.clock_mode = Prof::CPU
|
|
puts 'Using the fast ruby-prof extension'
|
|
require 'unprof'
|
|
rescue LoadError
|
|
puts 'Using the slow pure-Ruby profiler'
|
|
require 'profile'
|
|
end
|