some optimisations

This commit is contained in:
Andrew Williams 2011-03-01 22:06:42 +10:30
parent 4e8e5ee0d1
commit ce2e2fc9a6
4 changed files with 33 additions and 19 deletions

View file

@ -12,6 +12,8 @@ class BenchmarkCasted < Hash
end
class BenchmarkModel < CouchRest::Model::Base
use_database CouchRest.database!(ENV['BENCHMARK_DB'] || "http://localhost:5984/test")
property :string, String
property :number, Integer
property :casted, BenchmarkCasted
@ -60,5 +62,13 @@ begin
n.times { b.casted_list }
end
# db writing
if ENV['BENCHMARK_DB']
x.report("write record") do
# need to make change before it will save
n.times { b.string = "test#{n}"; b.save }
end
end
end
end