Created
March 23, 2009 15:14
-
-
Save lukemelia/83579 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
m_local = MemCache.new('127.0.0.1:11211') | |
=> <MemCache: 1 servers, ns: nil, ro: false> | |
>> m_remote = MemCache.new('ey04-s00298:11211') | |
=> <MemCache: 1 servers, ns: nil, ro: false> | |
>> | |
?> first_id = Sport.first.id | |
=> 1 | |
>> key = "Sport:#{first_id}" | |
=> "Sport:1" | |
>> m_local.set key, Sport.find(first_id) # prime cache | |
=> "STORED\r\n" | |
>> m_remote.set key, Sport.find(first_id) | |
=> "STORED\r\n" | |
>> | |
?> Benchmark.bm(20) do |b| | |
?> b.report "local" do | |
?> x.times do | |
?> m_local.get key | |
>> end | |
>> end | |
>> | |
?> b.report "remote" do | |
?> x.times do | |
?> m_remote.get key | |
>> end | |
>> end | |
>> end | |
user system total real | |
local 12.990000 0.400000 13.390000 ( 22.484441) | |
remote 12.970000 0.390000 13.360000 ( 24.380477) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment