Skip to content

Commit

Permalink
Revert benchmark changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ccocchi committed Sep 5, 2012
1 parent 44c7532 commit 1845a64
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions test/profile/benchmark.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

[
["memcached"],
["remix-stash", "remix/stash"],
[JRUBY ? "jruby-memcache-client" : "memcache-client", "memcache"],
["kgio"], ["dalli"]
].each do |gem_name, requirement|
begin
Expand All @@ -29,6 +31,11 @@
end
end

class Remix::Stash
# Remix::Stash API doesn't let you set servers
@@clusters = {:default => Remix::Stash::Cluster.new(['127.0.0.1:43042', '127.0.0.1:43043'])}
end

class Dalli::ClientCompat < Dalli::Client
def set(*args)
super(*args[0..2])
Expand All @@ -52,7 +59,7 @@ def prepend(*args)
class Bench

def initialize(loops = nil, stack_depth = nil)
@loops = (loops || 5000).to_i
@loops = (loops || 50000).to_i
@stack_depth = (stack_depth || 0).to_i

puts "PID is #{Process.pid}"
Expand Down Expand Up @@ -97,24 +104,26 @@ def reset_servers
def reset_clients
# Other clients
@clients = {
"dalli:bin" => Dalli::ClientCompat.new(['127.0.0.1:11211'], :marshal => false, :threadsafe => false)}
"mclient:ascii" => MemCache.new(['127.0.0.1:43042', '127.0.0.1:43043']),
"stash:bin" => Remix::Stash.new(:root),
"dalli:bin" => Dalli::ClientCompat.new(['127.0.0.1:43042', '127.0.0.1:43043'], :marshal => false, :threadsafe => false)}

# Us
@clients.merge!({
"libm:ascii" => Memcached::Rails.new(
['127.0.0.1:11211'],
['127.0.0.1:43042', '127.0.0.1:43043'],
:buffer_requests => false, :no_block => false, :namespace => "namespace"),
"libm:ascii:pipeline" => Memcached::Rails.new(
['127.0.0.1:11211'],
['127.0.0.1:43042', '127.0.0.1:43043'],
:no_block => true, :buffer_requests => true, :noreply => true, :namespace => "namespace"),
"libm:ascii:udp" => Memcached::Rails.new(
["#{UNIX_SOCKET_NAME}0", "#{UNIX_SOCKET_NAME}1"],
:buffer_requests => false, :no_block => false, :namespace => "namespace"),
"libm:bin" => Memcached::Rails.new(
['127.0.0.1:11211'],
['127.0.0.1:43042', '127.0.0.1:43043'],
:buffer_requests => false, :no_block => false, :namespace => "namespace", :binary_protocol => true),
"libm:bin:buffer" => Memcached::Rails.new(
['127.0.0.1:11211'],
['127.0.0.1:43042', '127.0.0.1:43043'],
:no_block => true, :buffer_requests => true, :namespace => "namespace", :binary_protocol => true)})
end

Expand Down

0 comments on commit 1845a64

Please sign in to comment.