Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 34 lines (26 sloc) 0.59 kb
721a122 @igrigorik for redis lookups, first query the first bit, if not set then missing,
authored
1 $:<< 'lib'
2
3 require 'benchmark'
4 require 'bloomfilter-rb'
5
6 n = 10000
7
8 Benchmark.bm do |x|
9 r = BloomFilter::Redis.new
10
11 x.report("insert") do
12 n.times do
13 r.insert("a")
14 end
15 end
16
17 x.report("lookup present") do
18 n.times do
19 r.include?("a")
20 end
21 end
22
23 x.report("lookup missing") do
24 n.times do
25 r.include?("b")
26 end
27 end
28
29 end
30
31 # user system total real
32 # insert 1.000000 0.380000 1.380000 ( 1.942181)
33 # lookup present 1.030000 0.470000 1.500000 ( 2.577577)
34 # lookup missing 0.370000 0.160000 0.530000 ( 1.060429)
Something went wrong with that request. Please try again.