memcached 0.5 → 0.6
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/CHANGELOG +2 -0
- data/Manifest +4 -2
- data/README +95 -11
- data/TODO +11 -0
- data/ext/extconf.rb +9 -1
- data/ext/libmemcached.i +12 -1
- data/ext/libmemcached_wrap.c +140 -0
- data/lib/memcached.rb +17 -0
- data/lib/memcached/behaviors.rb +6 -1
- data/lib/memcached/exceptions.rb +53 -8
- data/lib/memcached/memcached.rb +111 -35
- data/memcached.gemspec +18 -5
- data/test/benchmark/benchmark.rb +259 -0
- data/test/benchmark/benchmark_set_get.rb +56 -0
- data/test/benchmark/profile.rb +49 -0
- data/test/setup.rb +7 -5
- data/test/unit/memcached_test.rb +109 -18
- metadata +6 -5
- metadata.gz.sig +0 -0
- data/ext/libmemcached.h +0 -425
- data/test/benchmark/benchmark_test.rb +0 -42
@@ -1,42 +0,0 @@
|
|
1
|
-
|
2
|
-
require "#{File.dirname(__FILE__)}/../test_helper"
|
3
|
-
|
4
|
-
require 'rubygems'
|
5
|
-
require 'benchmark/unit'
|
6
|
-
require 'memcache'
|
7
|
-
|
8
|
-
class BenchmarkTest < Test::Unit::TestCase
|
9
|
-
|
10
|
-
def setup
|
11
|
-
@value = OpenStruct.new(:a => 1, :b => 2, :c => GenericClass)
|
12
|
-
@opts = [
|
13
|
-
['127.0.0.1:43042', '127.0.0.1:43043'],
|
14
|
-
{:namespace => "benchmark_namespace"}
|
15
|
-
]
|
16
|
-
end
|
17
|
-
|
18
|
-
def test_original_speed
|
19
|
-
@cache = MemCache.new(*@opts)
|
20
|
-
assert_faster(0.02) do
|
21
|
-
@cache.set 'key1', @value
|
22
|
-
@cache.get 'key1'
|
23
|
-
@cache.set 'key2', @value
|
24
|
-
@cache.set 'key3', @value
|
25
|
-
@cache.get 'key2'
|
26
|
-
@cache.get 'key3'
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def test_new_speed
|
31
|
-
@cache = Memcached.new(*@opts)
|
32
|
-
assert_faster(0.005) do
|
33
|
-
@cache.set 'key1', @value
|
34
|
-
@cache.get 'key1'
|
35
|
-
@cache.set 'key2', @value
|
36
|
-
@cache.set 'key3', @value
|
37
|
-
@cache.get 'key2'
|
38
|
-
@cache.get 'key3'
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
end
|