some optimisations
This commit is contained in:
parent
4e8e5ee0d1
commit
ce2e2fc9a6
4 changed files with 33 additions and 19 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue