Skip to content

Instantly share code, notes, and snippets.

@elight
Created October 7, 2008 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elight/15346 to your computer and use it in GitHub Desktop.
Save elight/15346 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'fiveruns-starling'
require 'benchmark'
q = Starling.new("127.0.0.1:22122")
num_times = 10_000
Benchmark.bmbm do |x|
x.report("push #{num_times}") do
num_times.times { |i| q.set("fiveruns_queue", i) }
end
x.report("pop #{num_times}") do
num_times.times { q.get("fiveruns_queue") }
end
end
# >> Rehearsal ----------------------------------------------
# >> push 10000 0.640000 0.300000 0.940000 ( 3.301577)
# >> pop 10000 0.760000 0.280000 1.040000 ( 3.086577)
# >> ------------------------------------- total: 1.980000sec
# >>
# >> user system total real
# >> push 10000 0.620000 0.280000 0.900000 ( 3.252381)
# >> pop 10000 0.800000 0.300000 1.100000 ( 3.289932)
require 'rubygems'
require 'starling'
require 'benchmark'
q = Starling.new("127.0.0.1:22122")
num_times = 10_000
Benchmark.bmbm do |x|
x.report("push #{num_times}") do
num_times.times { |i| q.set("0.9.3_queue", i) }
end
x.report("pop #{num_times}") do
num_times.times { q.get("0.9.3_queue") }
end
end
# >> Rehearsal ----------------------------------------------
# >> push 10000 0.970000 0.500000 1.470000 ( 10.971066)
# >> pop 10000 1.290000 0.540000 1.830000 ( 11.006818)
# >> ------------------------------------- total: 3.300000sec
# >>
# >> user system total real
# >> push 10000 0.970000 0.500000 1.470000 ( 10.463773)
# >> pop 10000 1.300000 0.540000 1.840000 ( 10.237169)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment