Sha256: 1b1866b7f438ab8bdab37969affe263e571ea047f0f2443fe380ef596816361c
Contents?: true
Size: 903 Bytes
Versions: 23
Compression:
Stored size: 903 Bytes
Contents
require 'rubygems' $LOAD_PATH.unshift("xampl_generated_code") require 'TokyoCabinetExperimental' Xampl.set_default_persister_kind(:tokyo_cabinet) Xampl.set_default_persister_format(:xml_format) module TokyoCabinetExperimental start = Time.now found = Xampl.transaction("setup") do @@persister.query do | q | q.add_condition('age', :numle, '50') end end query_done = Time.now total = 0 found.each do | person_meta | total += person_meta['age'].to_i end meta_done = Time.now total1 = 0 found.each do | person_meta | total1 += person_meta['xampl'].age.to_i end done = Time.now found.each do | person_meta | puts "name: #{ person_meta['name']}" end puts "found: #{ found.size }" puts "Total age: #{ total }, #{ total1 }" puts "done: #{ done - start }:: #{ query_done - start } + #{ meta_done - query_done } + #{ done - meta_done }" end
Version data entries
23 entries across 23 versions & 2 rubygems