Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

benchmark revelations...

  • Loading branch information...
commit f7f39b13ee0ef133535364ad1508f6eed9c35e45 1 parent 35dd48c
@nofxx authored
Showing with 16 additions and 17 deletions.
  1. +16 −17 benchmark/tokyo_store.rb
View
33 benchmark/tokyo_store.rb
@@ -9,27 +9,26 @@
@tokyo = ActiveSupport::Cache.lookup_store :tokyo_store, "localhost"
@memca = ActiveSupport::Cache.lookup_store :mem_cache_store, "localhost:11211"
+@memto = ActiveSupport::Cache.lookup_store :mem_cache_store, "localhost:45001"
# # # Read & Write
Benchmark.bmbm do |b|
- b.report("Tokyo#write") { 100_000.times { |i| @tokyo.write i.to_s, "x" }}
- b.report("Tokyo#read") { 100_000.times { |i| @tokyo.read i.to_s }}
+ b.report("TokyoStore#w") { 10_000.times { |i| @tokyo.write i.to_s, "x" }}
+ b.report("TokyoStore#r") { 10_000.times { |i| @tokyo.read i.to_s }}
+ b.report("MemCache#w") { 10_000.times { |i| @memca.write i.to_s, "x" }}
+ b.report("MemCache#r") { 10_000.times { |i| @memca.read i.to_s }}
+ b.report("MemCacheTo#w") { 10_000.times { |i| @memto.write i.to_s, "x" }}
+ b.report("MemCacheTo#r") { 10_000.times { |i| @memto.read i.to_s }}
end
-Benchmark.bmbm do |b|
- b.report("Memca#write") { 100_000.times { |i| @memca.write i.to_s, "x" }}
- b.report("Memca#read") { 100_000.times { |i| @memca.read i.to_s }}
-end
-
-
+puts
# # Read & Write
-# Benchmark.bmbm do |b|
-# b.report("Tokyo#write") { 100.times { |j| Thread.new { 10_000.times { |i| @tokyo.write "#{j}-#{i}", "x" }}}}
-# b.report("Tokyo#read") { 100.times { |j| Thread.new { 10_000.times { |i| @tokyo.read "#{j}-#{i}" }}}}
-# end
-
-# Benchmark.bmbm do |b|
-# b.report("Memca#write") { 100.times { |j| Thread.new { 10_000.times { |i| @memca.write "#{j}-#{i}", "x" }}}}
-# b.report("Memca#read") { 100.times { |j| Thread.new { 10_000.times { |i| @memca.read "#{j}-#{i}" }}}}
-# end
+Benchmark.bmbm do |b|
+ b.report("Tokyo#w") { 100.times { |j| Thread.new { 100.times { |i| @tokyo.write "#{j}-#{i}", "x" }}}}
+ b.report("Tokyo#r") { 100.times { |j| Thread.new { 100.times { |i| @tokyo.read "#{j}-#{i}" }}}}
+ b.report("MemCa#w") { 100.times { |j| Thread.new { 100.times { |i| @memca.write "#{j}-#{i}", "x" }}}}
+ b.report("Memca#r") { 100.times { |j| Thread.new { 100.times { |i| @memca.read "#{j}-#{i}" }}}}
+ b.report("Memto#w") { 100.times { |j| Thread.new { 100.times { |i| @memto.write "#{j}-#{i}", "x" }}}}
+ b.report("Memto#r") { 100.times { |j| Thread.new { 100.times { |i| @memto.read "#{j}-#{i}" }}}}
+end
Please sign in to comment.
Something went wrong with that request. Please try again.