lonbaker (owner)

Fork Of

Revisions

gist: 166785 Download_button fork
public
Public Clone URL: git://gist.github.com/166785.git
Embed All Files: show embed
couchdb and couch_fu #
1
2
3
4
5
6
7
8
9
10
11
#!/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)
 
mongodb and mongomapper #
1
2
3
4
5
6
7
8
9
10
11
#!/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)