Skip to content

Instantly share code, notes, and snippets.

@leshill
Created August 12, 2009 21:13
Show Gist options
  • Save leshill/166769 to your computer and use it in GitHub Desktop.
Save leshill/166769 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path(File.dirname(__FILE__) + "/../config/environment") unless defined?(RAILS_ROOT)
start_time = Time.now
puts "Starting CouchDB Benchmark..."
100000.times do |n|
Person.new(:first_name => "Couch_#{n}", :last_name => "Man_#{n}").save
end
puts (Time.now - start_time)
#!/usr/bin/env ruby
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path(File.dirname(__FILE__) + "/../config/environment") unless defined?(RAILS_ROOT)
start_time = Time.now
puts "Starting MongoDB Benchmark..."
100000.times do |n|
Patient.new(:first_name => "Mongo_#{n}", :last_name => "Man_#{n}").save
puts "."
end
puts (Time.now - start_time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment