Skip to content

Instantly share code, notes, and snippets.

@leshill
Created August 12, 2009 20:31
Show Gist options
  • Save leshill/166738 to your computer and use it in GitHub Desktop.
Save leshill/166738 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
if ARGV.any? {|arg| %w[--drb -X --generate-options -G --help -h --version -v].include?(arg)}
require 'rubygems' unless ENV['NO_RUBYGEMS']
else
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path(File.dirname(__FILE__) + "/../config/environment") unless defined?(RAILS_ROOT)
end
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