Created
August 30, 2013 23:14
-
-
Save rywall/6395171 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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