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

Version Path
hutch-xamplr-1.0.0 examples/tokyo-cabinet-experimental/expt-query3.rb
hutch-xamplr-1.0.1 examples/tokyo-cabinet-experimental/expt-query3.rb
hutch-xamplr-1.0.2 examples/tokyo-cabinet-experimental/expt-query3.rb
hutch-xamplr-1.0.3 examples/tokyo-cabinet-experimental/expt-query3.rb
hutch-xamplr-1.0.4 examples/tokyo-cabinet-experimental/expt-query3.rb
hutch-xamplr-1.0.5 examples/tokyo-cabinet-experimental/expt-query3.rb
hutch-xamplr-1.1.0 examples/tokyo-cabinet-experimental/expt-query3.rb
hutch-xamplr-1.1.1 examples/tokyo-cabinet-experimental/expt-query3.rb
hutch-xamplr-1.1.2 examples/tokyo-cabinet-experimental/expt-query3.rb
hutch-xamplr-1.1.4 examples/tokyo-cabinet-experimental/expt-query3.rb
hutch-xamplr-1.2.0 examples/tokyo-cabinet-experimental/expt-query3.rb
hutch-xamplr-1.3.0 examples/tokyo-cabinet-experimental/expt-query3.rb
hutch-xamplr-1.3.1 examples/tokyo-cabinet-experimental/expt-query3.rb
hutch-xamplr-1.3.10 examples/tokyo-cabinet-experimental/expt-query3.rb
hutch-xamplr-1.3.11 examples/tokyo-cabinet-experimental/expt-query3.rb
hutch-xamplr-1.3.12 examples/tokyo-cabinet-experimental/expt-query3.rb
hutch-xamplr-1.3.13 examples/tokyo-cabinet-experimental/expt-query3.rb
hutch-xamplr-1.3.14 examples/tokyo-cabinet-experimental/expt-query3.rb
hutch-xamplr-1.3.3 examples/tokyo-cabinet-experimental/expt-query3.rb
hutch-xamplr-1.3.8 examples/tokyo-cabinet-experimental/expt-query3.rb