Skip to content

Instantly share code, notes, and snippets.

@btucker
Created January 14, 2010 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save btucker/277319 to your computer and use it in GitHub Desktop.
Save btucker/277319 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require File.expand_path('../../config/environment', __FILE__)
how_many = 25000
my_class = Foo
my_class.delete_all
sc = my_class.create
my_class.benchmark "#{how_many} finds" do
how_many.times do
my_class.find(sc.id)
end
end
my_class.benchmark "#{how_many} creates" do
how_many.times do
my_class.create
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment