memcached 0.5 → 0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -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