hyperll 0.2.4 → 0.2.5

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.
@@ -0,0 +1,31 @@
1
+ require 'base64'
2
+ require 'hyperll'
3
+ require 'rblineprof'
4
+
5
+ fixtures = File.readlines(File.join(File.dirname(__FILE__), 'fixtures', '10000.txt'))
6
+ hllps = fixtures.map { |line|
7
+ Hyperll::HyperLogLogPlus.unserialize(Base64.decode64(line))
8
+ }
9
+
10
+ hllp = Hyperll::HyperLogLogPlus.new(11, 16)
11
+ profile = lineprof(/hyper_log_log_plus\.rb/) do
12
+ hllps.each do |h|
13
+ hllp.merge(h)
14
+ end
15
+ end
16
+
17
+ puts "Total cardinality: #{hllp.cardinality}"
18
+
19
+ profile.each do |file, lines|
20
+ File.readlines(file).each_with_index do |line, num|
21
+ wall, cpu, calls, allocations, *rest = lines[num+1]
22
+
23
+ if calls && calls > 0
24
+ printf "% 8.1fms + % 8.1fms (% 8d) | %s", cpu/1000.0, (wall-cpu)/1000.0, calls, line
25
+ # printf "% 8.1fms (% 5d) | %s", wall/1000.0, calls, line
26
+ else
27
+ printf " | %s", line
28
+ # printf " | %s", line
29
+ end
30
+ end
31
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyperll
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Lindeman
@@ -75,12 +75,14 @@ files:
75
75
  - lib/hyperll/register_set.rb
76
76
  - lib/hyperll/varint.rb
77
77
  - lib/hyperll/version.rb
78
+ - spec/fixtures/10000.txt
78
79
  - spec/hyperll/delta_bytes_spec.rb
79
80
  - spec/hyperll/hyper_log_log_plus_spec.rb
80
81
  - spec/hyperll/hyper_log_log_spec.rb
81
82
  - spec/hyperll/murmur_hash_spec.rb
82
83
  - spec/hyperll/register_set_spec.rb
83
84
  - spec/hyperll/varint_spec.rb
85
+ - spec/plus_merge_performance.rb
84
86
  - spec/spec_helper.rb
85
87
  homepage: https://github.com/alindeman/hyperll
86
88
  licenses:
@@ -107,10 +109,12 @@ signing_key:
107
109
  specification_version: 4
108
110
  summary: HyperLogLog implementation in pure Ruby
109
111
  test_files:
112
+ - spec/fixtures/10000.txt
110
113
  - spec/hyperll/delta_bytes_spec.rb
111
114
  - spec/hyperll/hyper_log_log_plus_spec.rb
112
115
  - spec/hyperll/hyper_log_log_spec.rb
113
116
  - spec/hyperll/murmur_hash_spec.rb
114
117
  - spec/hyperll/register_set_spec.rb
115
118
  - spec/hyperll/varint_spec.rb
119
+ - spec/plus_merge_performance.rb
116
120
  - spec/spec_helper.rb