Skip to content

Instantly share code, notes, and snippets.

@mmasaki
Created March 11, 2011 00:14
Show Gist options
  • Save mmasaki/865233 to your computer and use it in GitHub Desktop.
Save mmasaki/865233 to your computer and use it in GitHub Desktop.
Faster PStore
% time ruby pstore_bench.rb
ruby pstore_bench.rb 1.40s user 0.29s system 99% cpu 1.693 total
% time ruby pstore_bench.rb
ruby pstore_bench.rb 1.81s user 0.23s system 100% cpu 2.036 total
% time ruby pstore_bench.rb
ruby pstore_bench.rb 1.82s user 0.38s system 100% cpu 2.192 total
% time ruby pstore_bench.rb
ruby pstore_bench.rb 2.29s user 2.65s system 71% cpu 6.955 total
% time ruby pstore_bench.rb
ruby pstore_bench.rb 2.15s user 2.42s system 72% cpu 6.314 total
% time ruby pstore_bench.rb
ruby pstore_bench.rb 2.52s user 2.48s system 71% cpu 7.033 total
require 'pstore'
p = PStore.new("foo")
p.transaction { p["hoge"] = "hoge" }
10000.times do
p.transaction { p["hoge"] += "hoge" }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment