Sha256: f8133f73224e994b0ab5e43857aab78cb672d624dda7d8a2f763c9bb0f149dad

Contents?: true

Size: 937 Bytes

Versions: 23

Compression:

Stored size: 937 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')
      q.order_by('name', :strasc)
    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-query2.rb
hutch-xamplr-1.0.1 examples/tokyo-cabinet-experimental/expt-query2.rb
hutch-xamplr-1.0.2 examples/tokyo-cabinet-experimental/expt-query2.rb
hutch-xamplr-1.0.3 examples/tokyo-cabinet-experimental/expt-query2.rb
hutch-xamplr-1.0.4 examples/tokyo-cabinet-experimental/expt-query2.rb
hutch-xamplr-1.0.5 examples/tokyo-cabinet-experimental/expt-query2.rb
hutch-xamplr-1.1.0 examples/tokyo-cabinet-experimental/expt-query2.rb
hutch-xamplr-1.1.1 examples/tokyo-cabinet-experimental/expt-query2.rb
hutch-xamplr-1.1.2 examples/tokyo-cabinet-experimental/expt-query2.rb
hutch-xamplr-1.1.4 examples/tokyo-cabinet-experimental/expt-query2.rb
hutch-xamplr-1.2.0 examples/tokyo-cabinet-experimental/expt-query2.rb
hutch-xamplr-1.3.0 examples/tokyo-cabinet-experimental/expt-query2.rb
hutch-xamplr-1.3.1 examples/tokyo-cabinet-experimental/expt-query2.rb
hutch-xamplr-1.3.10 examples/tokyo-cabinet-experimental/expt-query2.rb
hutch-xamplr-1.3.11 examples/tokyo-cabinet-experimental/expt-query2.rb
hutch-xamplr-1.3.12 examples/tokyo-cabinet-experimental/expt-query2.rb
hutch-xamplr-1.3.13 examples/tokyo-cabinet-experimental/expt-query2.rb
hutch-xamplr-1.3.14 examples/tokyo-cabinet-experimental/expt-query2.rb
hutch-xamplr-1.3.3 examples/tokyo-cabinet-experimental/expt-query2.rb
hutch-xamplr-1.3.8 examples/tokyo-cabinet-experimental/expt-query2.rb