Skip to content

Instantly share code, notes, and snippets.

@rywall
Created August 30, 2013 23:14
Show Gist options
  • Save rywall/6395171 to your computer and use it in GitHub Desktop.
Save rywall/6395171 to your computer and use it in GitHub Desktop.
class CreateModels < ActiveRecord::Migration
def change
create_table :items do |t|
end
end
end
class Item < ActiveRecord::Base
end
CreateModels.new.change
puts "Populating Database"
1000.times do
Item.create
end
require 'benchmark'
puts 'Performance testing'
Benchmark.bm do |x|
x.report { 3.times { Item.pluck(:id) } }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment