Skip to content

Instantly share code, notes, and snippets.

@riffraff
Created May 30, 2011 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save riffraff/998973 to your computer and use it in GitHub Desktop.
Save riffraff/998973 to your computer and use it in GitHub Desktop.
task 'run' => :environment do
RubyProf.start
Bullet.enable=true
Bullet.start_request
20.times do
r = Rating.limit(20).includes(:comment => :post).to_a
end
Bullet.end_request
results = RubyProf.stop
File.open "#{Rails.root}/tmp/profile-bullet.txt", 'w' do |file|
RubyProf::FlatPrinter.new(results).print(file)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment