memcached 0.20.1 → 1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data.tar.gz.sig CHANGED
Binary file
data/BENCHMARKS CHANGED
@@ -9,112 +9,119 @@ You can easily run your own benchmarks, as long as you have memcached itself on
9
9
 
10
10
  These benchmarks were run on an OS X 10.5 Core 2 Duo machine:
11
11
 
12
- Ruby 1.8.7p174
13
- Loaded memcached 0.17
14
- Loaded binary42-remix-stash 0.9.5
15
- Loaded memcache-client 1.7.5
16
- Loops is 40000
12
+ Darwin amber.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT
13
+ 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386
14
+ Ruby 1.9.2p0
15
+ Loaded memcached 0.20.1
16
+ Loaded remix-stash 1.1.3
17
+ Loaded memcache-client 1.8.5
18
+ Loaded dalli 0.9.2
19
+ Loops is 20000
17
20
  Stack depth is 0
18
- Small value size is: 13 bytes
19
- Large value size is: 4158 bytes
20
-
21
+ Small value size is: 19 bytes
22
+ Large value size is: 4189 bytes
23
+ No matching processes belonging to you were found
21
24
  user system total real
22
- set:libm 1.360000 2.120000 3.480000 ( 8.952505)
23
- set:libm:binary 1.180000 2.100000 3.280000 ( 7.692065)
24
- set:libm:noblock 0.590000 0.240000 0.830000 ( 1.863921)
25
- set:libm:noblock_binary 0.470000 0.220000 0.690000 ( 1.678243)
26
- set:libm:udp 1.140000 1.150000 2.290000 ( 4.835305)
27
- set:ruby 15.440000 6.330000 21.770000 ( 22.136843)
28
- set:stash 5.780000 2.040000 7.820000 ( 13.748268)
29
- get:libm 1.600000 2.000000 3.600000 ( 8.112166)
30
- get:libm:binary 1.360000 2.150000 3.510000 ( 7.829266)
31
- get:libm:noblock 1.820000 2.630000 4.450000 ( 8.971191)
32
- get:libm:noblock_binary 1.560000 2.650000 4.210000 ( 8.114088)
33
- get:libm:udp 1.350000 1.140000 2.490000 ( 4.878485)
34
- get:ruby 18.640000 6.370000 25.010000 ( 25.925459)
35
- get:stash 5.120000 1.990000 7.110000 ( 11.850485)
36
- get-multi:libm 1.770000 1.320000 3.090000 ( 4.790793)
37
- get-multi:libm:binary 1.730000 1.740000 3.470000 ( 5.655120)
38
- get-multi:libm:noblock 1.820000 1.330000 3.150000 ( 4.841084)
39
- get-multi:libm:noblock_binary 1.740000 1.760000 3.500000 ( 5.616970)
40
- get-multi:libm:udp 1.690000 0.960000 2.650000 ( 3.551923)
41
- get-multi:ruby 21.380000 4.400000 25.780000 ( 26.017883)
42
- append:libm 1.500000 2.180000 3.680000 ( 14.658051)
43
- append:libm:binary 1.300000 2.110000 3.410000 ( 13.626305)
44
- append:libm:noblock 1.850000 2.870000 4.720000 ( 45.167145)
45
- append:libm:noblock_binary 1.640000 2.870000 4.510000 ( 44.614596)
46
- append:libm:udp 1.260000 1.170000 2.430000 ( 11.556293)
47
- append:ruby 16.770000 7.310000 24.080000 ( 29.525815)
48
- delete:libm 1.890000 2.080000 3.970000 ( 8.368548)
49
- delete:libm:binary 1.730000 2.090000 3.820000 ( 7.799952)
50
- delete:libm:noblock 0.850000 0.890000 1.740000 ( 2.530108)
51
- delete:libm:noblock_binary 0.710000 0.780000 1.490000 ( 2.390600)
52
- delete:libm:udp 1.700000 1.310000 3.010000 ( 6.508360)
53
- delete:ruby 15.670000 6.330000 22.000000 ( 22.226087)
54
- delete:stash 4.970000 2.010000 6.980000 ( 11.726916)
55
- get-missing:libm 2.070000 2.060000 4.130000 ( 8.937420)
56
- get-missing:libm:binary 2.010000 2.090000 4.100000 ( 8.506150)
57
- get-missing:libm:noblock 2.270000 2.770000 5.040000 ( 9.485592)
58
- get-missing:libm:noblock_binary 2.220000 2.760000 4.980000 ( 9.226826)
59
- get-missing:libm:udp 1.830000 1.300000 3.130000 ( 7.135699)
60
- get-missing:ruby 16.130000 6.380000 22.510000 ( 22.888698)
61
- get-missing:stash 5.030000 2.030000 7.060000 ( 11.556793)
62
- append-missing:libm 2.210000 2.070000 4.280000 ( 10.386632)
63
- append-missing:libm:binary 2.000000 2.060000 4.060000 ( 9.135312)
64
- append-missing:libm:noblock 2.400000 2.740000 5.140000 ( 10.821778)
65
- append-missing:libm:noblock_binary 2.200000 2.770000 4.970000 ( 9.699192)
66
- append-missing:libm:udp 1.970000 1.320000 3.290000 ( 7.668878)
67
- append-missing:ruby 15.970000 6.470000 22.440000 ( 22.912466)
68
- set-large:libm 1.460000 2.210000 3.670000 ( 9.517034)
69
- set-large:libm:binary 1.260000 2.270000 3.530000 ( 9.098769)
70
- set-large:libm:noblock 0.980000 0.890000 1.870000 ( 3.304075)
71
- set-large:libm:noblock_binary 0.840000 0.890000 1.730000 ( 3.444305)
72
- set-large:libm:udp 1.250000 1.330000 2.580000 ( 6.924254)
73
- set-large:ruby 16.960000 6.490000 23.450000 ( 23.964380)
74
- get-large:libm 2.280000 2.450000 4.730000 ( 9.908532)
75
- get-large:libm:binary 2.080000 2.530000 4.610000 ( 8.966637)
76
- get-large:libm:noblock 2.410000 2.850000 5.260000 ( 11.066391)
77
- get-large:libm:noblock_binary 2.200000 2.910000 5.110000 ( 10.328922)
78
- get-large:libm:udp 2.010000 1.430000 3.440000 ( 6.679192)
79
- get-large:ruby 21.790000 7.370000 29.160000 ( 29.578987)
80
- get-large:stash 5.430000 2.020000 7.450000 ( 11.967011)
81
- set-ruby:libm 1.800000 1.990000 3.790000 ( 9.511387)
82
- set-ruby:libm:binary 1.610000 2.000000 3.610000 ( 8.502297)
83
- set-ruby:libm:noblock 0.910000 0.200000 1.110000 ( 2.083001)
84
- set-ruby:libm:noblock_binary 0.750000 0.210000 0.960000 ( 1.895510)
85
- set-ruby:libm:udp 1.530000 1.170000 2.700000 ( 6.148442)
86
- set-ruby:ruby 16.290000 6.400000 22.690000 ( 23.672254)
87
- set-ruby:stash 5.570000 2.020000 7.590000 ( 13.381661)
88
- get-ruby:libm 1.920000 1.950000 3.870000 ( 9.042716)
89
- get-ruby:libm:binary 1.640000 1.980000 3.620000 ( 7.987886)
90
- get-ruby:libm:noblock 2.140000 2.600000 4.740000 ( 10.280036)
91
- get-ruby:libm:noblock_binary 1.870000 2.590000 4.460000 ( 9.213013)
92
- get-ruby:libm:udp 1.660000 1.170000 2.830000 ( 5.762381)
93
- get-ruby:ruby 19.760000 6.500000 26.260000 ( 27.573109)
94
- get-ruby:stash 5.480000 2.010000 7.490000 ( 12.349059)
95
- set-ruby-large:libm 33.820000 2.340000 36.160000 ( 43.061537)
96
- set-ruby-large:libm:binary 33.430000 2.260000 35.690000 ( 41.940845)
97
- set-ruby-large:libm:noblock 34.170000 0.930000 35.100000 ( 35.632694)
98
- set-ruby-large:libm:noblock_binary 34.010000 0.930000 34.940000 ( 35.383141)
99
- set-ruby-large:libm:udp 33.150000 1.430000 34.580000 ( 39.521448)
100
- set-ruby-large:ruby 48.830000 6.560000 55.390000 ( 55.750071)
101
- set-ruby-large:stash 38.660000 2.230000 40.890000 ( 46.957838)
102
- get-ruby-large:libm 23.570000 2.340000 25.910000 ( 32.166590)
103
- get-ruby-large:libm:binary 23.420000 2.510000 25.930000 ( 31.953854)
104
- get-ruby-large:libm:noblock 23.840000 3.040000 26.880000 ( 32.919639)
105
- get-ruby-large:libm:noblock_binary 23.570000 2.970000 26.540000 ( 32.210027)
106
- get-ruby-large:libm:udp 23.210000 1.460000 24.670000 ( 29.284808)
107
- get-ruby-large:ruby 41.170000 7.560000 48.730000 ( 49.507358)
108
- get-ruby-large:stash 25.760000 2.540000 28.300000 ( 33.998493)
109
- hash:fnv1a_64 0.240000 0.000000 0.240000 ( 0.247813)
110
- hash:murmur 0.190000 0.000000 0.190000 ( 0.193039)
111
- hash:default 0.220000 0.000000 0.220000 ( 0.216573)
112
- hash:jenkins 0.220000 0.000000 0.220000 ( 0.222694)
113
- hash:md5 0.390000 0.000000 0.390000 ( 0.395159)
114
- hash:crc 0.210000 0.000000 0.210000 ( 0.216457)
115
- hash:hsieh 0.100000 0.000000 0.100000 ( 0.104386)
116
- hash:fnv1_32 0.220000 0.000000 0.220000 ( 0.216769)
117
- hash:fnv1a_32 0.230000 0.000000 0.230000 ( 0.237016)
118
- hash:fnv1_64 0.450000 0.010000 0.460000 ( 0.454704)
119
-
120
-
25
+ set: dalli:bin 4.820000 1.510000 6.330000 ( 7.225315)
26
+ set: libm:ascii 0.570000 0.980000 1.550000 ( 4.003960)
27
+ set: libm:ascii:pipelined 0.170000 0.020000 0.190000 ( 0.203469)
28
+ set: libm:ascii:udp 0.450000 0.570000 1.020000 ( 2.077743)
29
+ set: libm:bin 0.480000 0.990000 1.470000 ( 3.692485)
30
+ set: libm:bin:buffered 0.140000 0.120000 0.260000 ( 0.870617)
31
+ set: mclient:ascii 7.300000 3.290000 10.590000 ( 11.325935)
32
+ set: stash:bin 2.600000 1.170000 3.770000 ( 6.621495)
33
+
34
+ get: dalli:bin 5.540000 1.660000 7.200000 ( 7.762690)
35
+ get: libm:ascii 0.680000 1.040000 1.720000 ( 3.918273)
36
+ get: libm:ascii:pipelined 0.780000 1.270000 2.050000 ( 4.130800)
37
+ get: libm:ascii:udp 0.580000 0.570000 1.150000 ( 2.097873)
38
+ get: libm:bin 0.560000 1.000000 1.560000 ( 3.504147)
39
+ get: libm:bin:buffered 0.670000 1.330000 2.000000 ( 4.134638)
40
+ get: mclient:ascii 8.820000 3.440000 12.260000 ( 12.775693)
41
+ get: stash:bin 2.390000 1.310000 3.700000 ( 5.927902)
42
+
43
+ get-multi: dalli:bin 6.910000 2.790000 9.700000 ( 10.351834)
44
+ get-multi: libm:ascii 0.780000 0.640000 1.420000 ( 2.400928)
45
+ get-multi: libm:ascii:pipelined 0.780000 0.650000 1.430000 ( 2.398865)
46
+ get-multi: libm:ascii:udp 0.730000 0.480000 1.210000 ( 1.667487)
47
+ get-multi: libm:bin 0.790000 0.940000 1.730000 ( 3.077329)
48
+ get-multi: libm:bin:buffered 0.800000 0.980000 1.780000 ( 3.120033)
49
+
50
+ append: dalli:bin 5.340000 1.820000 7.160000 ( 9.463384)
51
+ append: libm:ascii 0.610000 1.060000 1.670000 ( 6.177618)
52
+ append: libm:ascii:pipelined 0.190000 0.040000 0.230000 ( 10.719099)
53
+ append: libm:ascii:udp 0.500000 0.590000 1.090000 ( 4.877804)
54
+ append: libm:bin 0.530000 1.030000 1.560000 ( 12.678462)
55
+ append: libm:bin:buffered 0.800000 1.480000 2.280000 ( 20.612821)
56
+ append: mclient:ascii 7.680000 3.500000 11.180000 ( 17.252513)
57
+
58
+ prepend: dalli:bin 7.020000 1.990000 9.010000 ( 13.790809)
59
+ prepend: libm:ascii 0.860000 1.160000 2.020000 ( 22.172399)
60
+ prepend: libm:ascii:pipelined 0.180000 0.020000 0.200000 ( 0.228367)
61
+ prepend: libm:ascii:udp 0.540000 0.630000 1.170000 ( 14.770980)
62
+ prepend: libm:bin 1.150000 1.050000 2.200000 ( 5.341857)
63
+ prepend: libm:bin:buffered 1.250000 1.390000 2.640000 ( 5.621586)
64
+ prepend: mclient:ascii 7.650000 3.420000 11.070000 ( 11.717946)
65
+
66
+ delete: dalli:bin 5.320000 1.760000 7.080000 ( 7.442455)
67
+ delete: libm:ascii 1.150000 1.050000 2.200000 ( 4.588383)
68
+ delete: libm:ascii:pipelined 0.290000 0.370000 0.660000 ( 0.773548)
69
+ delete: libm:ascii:udp 1.060000 0.660000 1.720000 ( 3.389179)
70
+ delete: libm:bin 1.080000 1.040000 2.120000 ( 4.461896)
71
+ delete: libm:bin:buffered 0.230000 0.350000 0.580000 ( 1.114071)
72
+ delete: mclient:ascii 7.640000 3.380000 11.020000 ( 11.271308)
73
+
74
+ get-missing: dalli:bin 5.410000 1.760000 7.170000 ( 7.756717)
75
+ get-missing: libm:ascii 1.190000 1.000000 2.190000 ( 4.992572)
76
+ get-missing: libm:ascii:pipelined 1.290000 1.410000 2.700000 ( 4.775207)
77
+ get-missing: libm:ascii:udp 1.090000 0.660000 1.750000 ( 3.354907)
78
+ get-missing: libm:bin 1.170000 1.060000 2.230000 ( 4.550311)
79
+ get-missing: libm:bin:buffered 1.270000 1.390000 2.660000 ( 4.834454)
80
+ get-missing: mclient:ascii 7.570000 3.390000 10.960000 ( 11.470425)
81
+ get-missing: stash:bin 2.350000 1.340000 3.690000 ( 6.073585)
82
+
83
+ append-missing: dalli:bin 7.740000 1.980000 9.720000 ( 10.168658)
84
+ append-missing: libm:ascii 1.240000 1.070000 2.310000 ( 5.397586)
85
+ append-missing: libm:ascii:pipelined 0.190000 0.020000 0.210000 ( 0.227031)
86
+ append-missing: libm:ascii:udp 1.130000 0.680000 1.810000 ( 3.926319)
87
+ append-missing: libm:bin 1.140000 1.060000 2.200000 ( 4.798300)
88
+ append-missing: libm:bin:buffered 1.250000 1.410000 2.660000 ( 5.091978)
89
+ append-missing: mclient:ascii 7.830000 3.440000 11.270000 ( 11.654683)
90
+
91
+ prepend-missing: dalli:bin 7.750000 1.990000 9.740000 ( 10.179379)
92
+ prepend-missing: libm:ascii 1.240000 1.070000 2.310000 ( 5.418788)
93
+ prepend-missing: libm:ascii:pipelined 0.180000 0.010000 0.190000 ( 0.201024)
94
+ prepend-missing: libm:ascii:udp 1.120000 0.680000 1.800000 ( 3.931292)
95
+ prepend-missing: libm:bin 1.150000 1.070000 2.220000 ( 4.820438)
96
+ prepend-missing: libm:bin:buffered 1.240000 1.410000 2.650000 ( 5.083105)
97
+ prepend-missing: mclient:ascii 7.850000 3.450000 11.300000 ( 11.663710)
98
+
99
+ set-large: dalli:bin 5.470000 1.700000 7.170000 ( 7.819158)
100
+ set-large: libm:ascii 0.620000 1.120000 1.740000 ( 4.489379)
101
+ set-large: libm:ascii:pipelined 0.330000 0.290000 0.620000 ( 1.235649)
102
+ set-large: libm:ascii:udp 0.500000 0.650000 1.150000 ( 3.026405)
103
+ set-large: libm:bin 0.510000 1.060000 1.570000 ( 4.105516)
104
+ set-large: libm:bin:buffered 0.300000 0.460000 0.760000 ( 1.590685)
105
+ set-large: mclient:ascii 8.170000 3.580000 11.750000 ( 12.304508)
106
+ set-large: stash:bin 3.820000 1.190000 5.010000 ( 7.826406)
107
+
108
+ get-large: dalli:bin 6.070000 1.980000 8.050000 ( 8.625461)
109
+ get-large: libm:ascii 0.920000 1.090000 2.010000 ( 4.725218)
110
+ get-large: libm:ascii:pipelined 1.010000 1.470000 2.480000 ( 5.123318)
111
+ get-large: libm:ascii:udp 0.840000 0.740000 1.580000 ( 2.479091)
112
+ get-large: libm:bin 0.810000 1.200000 2.010000 ( 4.404212)
113
+ get-large: libm:bin:buffered 0.890000 1.430000 2.320000 ( 4.991805)
114
+ get-large: mclient:ascii 10.270000 4.040000 14.310000 ( 14.881824)
115
+ get-large: stash:bin 2.480000 1.350000 3.830000 ( 6.041167)
116
+
117
+ hash:default 0.330000 0.000000 0.330000 ( 0.338913)
118
+ hash:md5 0.740000 0.000000 0.740000 ( 0.749003)
119
+ hash:crc 0.430000 0.010000 0.440000 ( 0.428859)
120
+ hash:fnv1_64 0.800000 0.000000 0.800000 ( 0.814617)
121
+ hash:fnv1a_64 0.290000 0.000000 0.290000 ( 0.289964)
122
+ hash:fnv1_32 0.270000 0.000000 0.270000 ( 0.273325)
123
+ hash:fnv1a_32 0.280000 0.010000 0.290000 ( 0.307831)
124
+ hash:hsieh 0.130000 0.000000 0.130000 ( 0.128252)
125
+ hash:murmur 0.210000 0.000000 0.210000 ( 0.212935)
126
+ hash:jenkins 0.250000 0.000000 0.250000 ( 0.257421)
127
+ hash:none 0.130000 0.000000 0.130000 ( 0.124726)
data/CHANGELOG CHANGED
@@ -1,4 +1,6 @@
1
1
 
2
+ v1. Fix empty string return value bug in multiget.
3
+
2
4
  v0.20.1. Better module naming. Oops.
3
5
 
4
6
  v0.20.0. Add experimental module, with get_len() operator (rgbenson).
data/README CHANGED
@@ -16,13 +16,13 @@ If you use this software, please {make a donation}[http://blog.evanweaver.com/do
16
16
  * clean API
17
17
  * robust access to all memcached features
18
18
  * multiple hashing modes, including consistent hashing
19
- * ludicrous speed, including optional non-blocking IO
19
+ * ludicrous speed, including optional pipelined IO with no_reply
20
20
 
21
21
  The <b>memcached</b> library wraps the pure-C libmemcached client via SWIG.
22
22
 
23
23
  == Installation
24
24
 
25
- You need Ruby 1.8.7 or Ruby 1.9.1. Other versions may work, but are not guaranteed. You also need the libsasl2-dev library, which should be provided through your system's package manager.
25
+ You need Ruby 1.8.7 or Ruby 1.9.2. Other versions may work, but are not guaranteed. You also need the libsasl2-dev library, which should be provided through your system's package manager.
26
26
 
27
27
  Install the gem:
28
28
  sudo gem install memcached --no-rdoc --no-ri
@@ -97,7 +97,7 @@ There is a compatibility wrapper for legacy applications called Memcached::Rails
97
97
 
98
98
  == Benchmarks
99
99
 
100
- <b>memcached</b> is up to 10x faster than <b>memcache-client</b>. See BENCHMARKS[link:files/BENCHMARKS.html] for details.
100
+ <b>memcached</b>, correctly configured, is up to 60x faster than <b>memcache-client</b> or <b>dalli</b>. See BENCHMARKS[link:files/BENCHMARKS.html] for details.
101
101
 
102
102
  == Reporting problems
103
103
 
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ Echoe.new("memcached") do |p|
6
6
  p.summary = "An interface to the libmemcached C client."
7
7
  p.url = "http://blog.evanweaver.com/files/doc/fauna/memcached/"
8
8
  p.docs_host = "blog.evanweaver.com:~/www/bax/public/files/doc/"
9
- p.rdoc_pattern = /README|TODO|LICENSE|CHANGELOG|BENCH|COMPAT|exceptions|behaviors|rails.rb|memcached.rb/
9
+ p.rdoc_pattern = /README|TODO|LICENSE|CHANGELOG|BENCH|COMPAT|exceptions|experimental.rb|behaviors|rails.rb|memcached.rb/
10
10
  p.clean_pattern += ["ext/lib", "ext/include", "ext/share", "ext/libmemcached-?.??", "ext/bin", "ext/conftest.dSYM"]
11
11
  end
12
12
 
@@ -196,13 +196,9 @@ VALUE memcached_fetch_rvalue(memcached_st *ptr, char *key, size_t *key_length, u
196
196
  VALUE result = rb_ary_new();
197
197
 
198
198
  char *value = memcached_fetch(ptr, key, key_length, &value_length, flags, error);
199
- if (value == NULL) {
200
- rb_ary_push(result, Qnil);
201
- } else {
202
- VALUE ret = rb_str_new(value, value_length);
203
- rb_ary_push(result, ret);
204
- free(value);
205
- }
199
+ VALUE ret = rb_str_new(value, value_length);
200
+ rb_ary_push(result, ret);
201
+ free(value);
206
202
  return result;
207
203
  };
208
204
  %}
@@ -2285,13 +2285,9 @@ VALUE memcached_fetch_rvalue(memcached_st *ptr, char *key, size_t *key_length, u
2285
2285
  VALUE result = rb_ary_new();
2286
2286
 
2287
2287
  char *value = memcached_fetch(ptr, key, key_length, &value_length, flags, error);
2288
- if (value == NULL) {
2289
- rb_ary_push(result, Qnil);
2290
- } else {
2291
- VALUE ret = rb_str_new(value, value_length);
2292
- rb_ary_push(result, ret);
2293
- free(value);
2294
- }
2288
+ VALUE ret = rb_str_new(value, value_length);
2289
+ rb_ary_push(result, ret);
2290
+ free(value); // SWIG apparently handles when value is NULL
2295
2291
  return result;
2296
2292
  };
2297
2293
 
@@ -2,16 +2,16 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{memcached}
5
- s.version = "0.20.1"
5
+ s.version = "1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Evan Weaver"]
9
9
  s.cert_chain = ["/Users/eweaver/p/configuration/gem_certificates/evan_weaver-original-public_cert.pem"]
10
- s.date = %q{2010-08-03}
10
+ s.date = %q{2010-09-08}
11
11
  s.description = %q{An interface to the libmemcached C client.}
12
12
  s.email = %q{}
13
13
  s.extensions = ["ext/extconf.rb"]
14
- s.extra_rdoc_files = ["BENCHMARKS", "CHANGELOG", "LICENSE", "README", "TODO", "lib/memcached.rb", "lib/memcached/behaviors.rb", "lib/memcached/exceptions.rb", "lib/memcached/memcached.rb", "lib/memcached/rails.rb"]
14
+ s.extra_rdoc_files = ["BENCHMARKS", "CHANGELOG", "LICENSE", "README", "TODO", "lib/memcached.rb", "lib/memcached/behaviors.rb", "lib/memcached/exceptions.rb", "lib/memcached/experimental.rb", "lib/memcached/memcached.rb", "lib/memcached/rails.rb"]
15
15
  s.files = ["BENCHMARKS", "CHANGELOG", "LICENSE", "Manifest", "README", "Rakefile", "TODO", "ext/extconf.rb", "ext/libmemcached-0.32.tar.gz", "ext/libmemcached-2.patch", "ext/libmemcached-3.patch", "ext/libmemcached-4.patch", "ext/libmemcached-5.patch", "ext/libmemcached.patch", "ext/rlibmemcached.i", "ext/rlibmemcached_wrap.c", "ext/sasl.patch", "lib/memcached.rb", "lib/memcached/auth.rb", "lib/memcached/behaviors.rb", "lib/memcached/exceptions.rb", "lib/memcached/experimental.rb", "lib/memcached/integer.rb", "lib/memcached/memcached.rb", "lib/memcached/rails.rb", "test/profile/benchmark.rb", "test/profile/profile.rb", "test/profile/valgrind.rb", "test/setup.rb", "test/teardown.rb", "test/test_helper.rb", "test/unit/binding_test.rb", "test/unit/memcached_experimental_test.rb", "test/unit/memcached_test.rb", "test/unit/rails_test.rb", "memcached.gemspec"]
16
16
  s.homepage = %q{http://blog.evanweaver.com/files/doc/fauna/memcached/}
17
17
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Memcached", "--main", "README"]
@@ -13,9 +13,10 @@ puts `uname -a`
13
13
  puts "Ruby #{RUBY_VERSION}p#{RUBY_PATCHLEVEL}"
14
14
 
15
15
  [ ["memcached", "memcached"],
16
- ["binary42-remix-stash", "remix/stash"],
16
+ ["remix-stash", "remix/stash"],
17
17
  # ["astro-remcached", "remcached"], # Clobbers the "Memcached" constant
18
- ["memcache-client", "memcache"]].each do |gem_name, requirement|
18
+ ["memcache-client", "memcache"],
19
+ ["dalli","dalli"]].each do |gem_name, requirement|
19
20
  require requirement
20
21
  gem gem_name
21
22
  puts "Loaded #{gem_name} #{Gem.loaded_specs[gem_name].version.to_s rescue nil}"
@@ -26,6 +27,26 @@ class Remix::Stash
26
27
  @@clusters = {:default => Remix::Stash::Cluster.new(['127.0.0.1:43042', '127.0.0.1:43043'])}
27
28
  end
28
29
 
30
+ class Dalli::ClientCompat < Dalli::Client
31
+ def set(*args)
32
+ super(*args[0..2])
33
+ end
34
+ def get(*args)
35
+ super(args.first)
36
+ end
37
+ def get_multi(*args)
38
+ super(args.first)
39
+ end
40
+ def append(*args)
41
+ super
42
+ rescue Dalli::DalliError
43
+ end
44
+ def prepend(*args)
45
+ super
46
+ rescue Dalli::DalliError
47
+ end
48
+ end
49
+
29
50
  class Bench
30
51
 
31
52
  def initialize(loops = nil, stack_depth = nil)
@@ -72,23 +93,24 @@ class Bench
72
93
 
73
94
  def reset_clients
74
95
  @clients = {
75
- "libm" => Memcached::Rails.new(
96
+ "libm:ascii" => Memcached::Rails.new(
76
97
  ['127.0.0.1:43042', '127.0.0.1:43043'],
77
98
  :buffer_requests => false, :no_block => false, :namespace => "namespace"),
78
- "libm:noblock" => Memcached::Rails.new(
99
+ "libm:ascii:pipeline" => Memcached::Rails.new(
79
100
  ['127.0.0.1:43042', '127.0.0.1:43043'],
80
- :no_block => true, :buffer_requests => true, :namespace => "namespace"),
81
- "libm:udp" => Memcached::Rails.new(
101
+ :no_block => true, :buffer_requests => true, :noreply => true, :namespace => "namespace"),
102
+ "libm:ascii:udp" => Memcached::Rails.new(
82
103
  ["#{UNIX_SOCKET_NAME}0", "#{UNIX_SOCKET_NAME}1"],
83
104
  :buffer_requests => false, :no_block => false, :namespace => "namespace"),
84
- "libm:binary" => Memcached::Rails.new(
105
+ "libm:bin" => Memcached::Rails.new(
85
106
  ['127.0.0.1:43042', '127.0.0.1:43043'],
86
107
  :buffer_requests => false, :no_block => false, :namespace => "namespace", :binary_protocol => true),
87
- "libm:noblock_binary" => Memcached::Rails.new(
108
+ "libm:bin:buffer" => Memcached::Rails.new(
88
109
  ['127.0.0.1:43042', '127.0.0.1:43043'],
89
110
  :no_block => true, :buffer_requests => true, :namespace => "namespace", :binary_protocol => true),
90
- "ruby" => Memcache.new(:servers => ['127.0.0.1:43042', '127.0.0.1:43043'], :namespace => "namespace"),
91
- "stash" => Remix::Stash.new(:root)}
111
+ "mclient:ascii" => MemCache.new(['127.0.0.1:43042', '127.0.0.1:43043']),
112
+ "stash:bin" => Remix::Stash.new(:root),
113
+ "dalli:bin" => Dalli::ClientCompat.new(['127.0.0.1:43042', '127.0.0.1:43043'], :marshal => false, :threadsafe => false)}
92
114
  end
93
115
 
94
116
 
@@ -98,19 +120,20 @@ class Bench
98
120
  client = clients[client_name]
99
121
  begin
100
122
  yield client
101
- @benchmark.report("#{test_name}:#{client_name}") { @loops.times { yield client } }
123
+ @benchmark.report("#{test_name}: #{client_name}") { @loops.times { yield client } }
102
124
  rescue => e
103
- # puts "#{test_name}:#{client_name} => #{e.class}"
125
+ # puts "#{test_name}:#{client_name} => #{e.inspect}"
104
126
  # reset_clients
105
127
  end
106
128
  end
129
+ puts
107
130
  end
108
131
 
109
132
  def benchmark_hashes(hashes, test_name)
110
133
  hashes.each do |hash_name, int|
111
134
  @m = Memcached::Rails.new(:hash => hash_name)
112
135
  @benchmark.report("#{test_name}:#{hash_name}") do
113
- @loops.times { yield int }
136
+ (@loops * 5).times { yield int }
114
137
  end
115
138
  end
116
139
  end
@@ -137,7 +160,13 @@ class Bench
137
160
  c.append @k2, @m_value
138
161
  c.append @k3, @m_value
139
162
  end
140
-
163
+
164
+ benchmark_clients("prepend") do |c|
165
+ c.prepend @k1, @m_value
166
+ c.prepend @k2, @m_value
167
+ c.prepend @k3, @m_value
168
+ end
169
+
141
170
  benchmark_clients("delete") do |c|
142
171
  c.delete @k1
143
172
  c.delete @k2
@@ -156,6 +185,12 @@ class Bench
156
185
  c.append @k3, @m_value
157
186
  end
158
187
 
188
+ benchmark_clients("prepend-missing") do |c|
189
+ c.prepend @k1, @m_value
190
+ c.prepend @k2, @m_value
191
+ c.prepend @k3, @m_value
192
+ end
193
+
159
194
  benchmark_clients("set-large") do |c|
160
195
  c.set @k1, @m_large_value, 0, true
161
196
  c.set @k2, @m_large_value, 0, true
@@ -167,30 +202,6 @@ class Bench
167
202
  c.get @k2, true
168
203
  c.get @k3, true
169
204
  end
170
-
171
- benchmark_clients("set-ruby") do |c|
172
- c.set @k1, @value
173
- c.set @k2, @value
174
- c.set @k3, @value
175
- end
176
-
177
- benchmark_clients("get-ruby") do |c|
178
- c.get @k1
179
- c.get @k2
180
- c.get @k3
181
- end
182
-
183
- benchmark_clients("set-ruby-large") do |c|
184
- c.set @k1, @large_value
185
- c.set @k2, @large_value
186
- c.set @k3, @large_value
187
- end
188
-
189
- benchmark_clients("get-ruby-large") do |c|
190
- c.get @k1
191
- c.get @k2
192
- c.get @k3
193
- end
194
205
 
195
206
  benchmark_hashes(Memcached::HASH_VALUES, "hash") do |i|
196
207
  Rlibmemcached.memcached_generate_hash_rvalue(@k1, i)
@@ -259,9 +259,7 @@ class MemcachedTest < Test::Unit::TestCase
259
259
 
260
260
  def test_get_from_last
261
261
  cache = Memcached.new(@servers, :distribution => :random)
262
- 10.times do |n|
263
- cache.set key, n
264
- end
262
+ 10.times { |n| cache.set key, n }
265
263
  10.times do
266
264
  assert_equal cache.get(key), cache.get_from_last(key)
267
265
  end
@@ -390,6 +388,12 @@ class MemcachedTest < Test::Unit::TestCase
390
388
  @cache.get(["#{key}_1", "#{key}_2"])
391
389
  )
392
390
  end
391
+
392
+ def test_get_multi_empty_string
393
+ @cache.set "#{key}_1", "", 0, false
394
+ assert_equal({"#{key}_1" => ""},
395
+ @cache.get(["#{key}_1"], false))
396
+ end
393
397
 
394
398
  def test_get_multi_checks_types
395
399
  assert_raises(TypeError, ArgumentError) do
@@ -19,13 +19,18 @@ class RailsTest < Test::Unit::TestCase
19
19
 
20
20
  def test_get_multi
21
21
  @cache.set key, @value
22
- result = @cache.get_multi([key])
23
22
  assert_equal(
24
23
  {key => @value},
25
- result
26
- )
24
+ @cache.get_multi([key]))
27
25
  end
28
-
26
+
27
+ def test_get_multi_empty_string
28
+ @cache.set key, "", 0, true
29
+ assert_equal(
30
+ {key => ""},
31
+ @cache.get_multi([key], true))
32
+ end
33
+
29
34
  def test_delete
30
35
  @cache.set key, @value
31
36
  assert_nothing_raised do
metadata CHANGED
@@ -3,10 +3,8 @@ name: memcached
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
- - 0
7
- - 20
8
6
  - 1
9
- version: 0.20.1
7
+ version: "1"
10
8
  platform: ruby
11
9
  authors:
12
10
  - Evan Weaver
@@ -35,7 +33,7 @@ cert_chain:
35
33
  yZ0=
36
34
  -----END CERTIFICATE-----
37
35
 
38
- date: 2010-08-03 00:00:00 -07:00
36
+ date: 2010-09-08 00:00:00 -07:00
39
37
  default_executable:
40
38
  dependencies: []
41
39
 
@@ -54,6 +52,7 @@ extra_rdoc_files:
54
52
  - lib/memcached.rb
55
53
  - lib/memcached/behaviors.rb
56
54
  - lib/memcached/exceptions.rb
55
+ - lib/memcached/experimental.rb
57
56
  - lib/memcached/memcached.rb
58
57
  - lib/memcached/rails.rb
59
58
  files:
metadata.gz.sig CHANGED
Binary file