d_heap 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,6 +6,7 @@ prelude: |
6
6
  fill_random_vals
7
7
 
8
8
  n = ENV.fetch("BENCH_N", 1000).to_i
9
+
9
10
  i = 0
10
11
 
11
12
  benchmark:
@@ -26,6 +27,9 @@ benchmark:
26
27
  - script: *script
27
28
  name: "push N + pop N (rb_heap)"
28
29
  prelude: "q = initq RbHeap"
30
+ - script: *script
31
+ name: "push N + pop N (c++ stl)"
32
+ prelude: "q = initq CppSTL"
29
33
  - script: *script
30
34
  name: "push N + pop N (c_dheap)"
31
35
  prelude: "q = initq DHeap"
@@ -12,13 +12,16 @@ benchmark:
12
12
  q << random_val
13
13
  q.pop
14
14
  name: "push + pop (findmin)"
15
- prelude: "q = initq FindMin, n"
15
+ prelude: "q = FindMin.new(n) { random_val }"
16
16
  - script: *script
17
17
  name: "push + pop (bsearch)"
18
- prelude: "q = initq BSearch, n"
18
+ prelude: "q = BSearch.new(n) { random_val }"
19
19
  - script: *script
20
20
  name: "push + pop (rb_heap)"
21
- prelude: "q = initq RbHeap, n"
21
+ prelude: "q = RbHeap.new(n) { random_val }"
22
+ - script: *script
23
+ name: "push + pop (c++ stl)"
24
+ prelude: "q = initq CppSTL, n"
22
25
  - script: *script
23
26
  name: "push + pop (c_dheap)"
24
27
  prelude: "q = initq DHeap, n"
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "stackprof"
5
+
6
+ system("#{RbConfig.ruby} bin/rake compile", err: :out, exception: true)
7
+ require "d_heap/benchmarks"
8
+ include DHeap::Benchmarks # rubocop:disable Style/MixinUsage
9
+ fill_random_vals
10
+
11
+ n = ENV.fetch("BENCH_N", 5_000_000).to_i
12
+ interval = ENV.fetch("PROF_INTERVAL", 100).to_i # measured in μs
13
+
14
+ i = 0
15
+
16
+ q = initq RbHeap
17
+ n.times { q << n }
18
+ q.clear
19
+
20
+ StackProf.run(mode: :cpu, out: "stackprof-cpu-push.dump", interval: interval) do
21
+ while i < n
22
+ q << random_val
23
+ i += 1
24
+ end
25
+ end
26
+ StackProf.run(mode: :cpu, out: "stackprof-cpu-pop.dump", interval: interval) do
27
+ while 0 < i # rubocop:disable Style/NumericPredicate
28
+ q.pop
29
+ i -= 1
30
+ end
31
+ end
@@ -1,52 +1,75 @@
1
- Benchmarking run at 2021-01-11 23:29:03 -0500
2
- ruby v2.7.2, DHeap v0.4.0
3
-
4
1
  Warming up --------------------------------------
5
- push + pop (findmin) 12.852k i/s - 13.364k times in 1.039832s (77.81μs/i)
6
- push + pop (bsearch) 1.531M i/s - 1.603M times in 1.047477s (653.25ns/i)
7
- push + pop (rb_heap) 485.963k i/s - 500.745k times in 1.030417s (2.06μs/i)
8
- push + pop (c_dheap) 3.070M i/s - 3.147M times in 1.025047s (325.74ns/i, 687clocks/i)
2
+ push + pop (findmin) 136.044 i/s - 140.000 times in 1.029078s (7.35ms/i)
3
+ push + pop (bsearch) 5.700k i/s - 5.984k times in 1.049902s (175.45μs/i)
4
+ push + pop (rb_heap) 466.447k i/s - 496.977k times in 1.065453s (2.14μs/i)
5
+ push + pop (c++ stl) 3.023M i/s - 3.038M times in 1.004830s (330.81ns/i, 794clocks/i)
6
+ push + pop (c_dheap) 3.579M i/s - 3.620M times in 1.011429s (279.40ns/i, 785clocks/i)
9
7
  Calculating -------------------------------------
10
- bin/bench_n 20000 bin/bench_n 40000 bin/bench_n 60000 bin/bench_n 80000 bin/bench_n 100000 bin/bench_n 120000 bin/bench_n 140000
11
- push + pop (findmin) 14.131k 6.039k 3.760k 2.727k 2.136k 1.736k 1.477k i/s - 38.556k times in 2.728481s 6.384254s 10.254074s 14.136144s 18.049587s 22.204711s 26.106433s
12
- push + pop (bsearch) 1.544M 1.312M 1.118M 877.817k 697.832k 570.122k 459.166k i/s - 4.592M times in 2.975164s 3.500284s 4.107319s 5.231671s 6.581027s 8.055201s 10.001713s
13
- push + pop (rb_heap) 539.712k 512.212k 499.451k 484.457k 452.217k 497.861k 412.057k i/s - 1.458M times in 2.701239s 2.846265s 2.918984s 3.009325s 3.223875s 2.928307s 3.538075s
14
- push + pop (c_dheap) 3.153M 2.756M 2.831M 2.912M 2.539M 2.552M 2.587M i/s - 9.210M times in 2.921285s 3.341750s 3.252966s 3.162880s 3.627868s 3.608295s 3.560563s
8
+ bin/bench_n 1000000 bin/bench_n 10000 bin/bench_n 25000 bin/bench_n 50000 bin/bench_n 100000 bin/bench_n 250000 bin/bench_n 500000 bin/bench_n 10000000 bin/bench_n 2500000 bin/bench_n 5000000
9
+ push + pop (findmin) 136.690 11.014k 4.426k 2.178k 1.084k 408.671 215.680 13.169 52.037 26.307 i/s - 408.000 times in 2.984861s 0.037045s 0.092186s 0.187334s 0.376306s 0.998359s 1.891687s 30.981982s 7.840594s 15.509132s
10
+ push + pop (bsearch) 5.639k 786.334k 364.964k 200.521k 88.607k 34.530k 17.965k 288.811 1.302k 592.009 i/s - 17.098k times in 3.032244s 0.021744s 0.046848s 0.085268s 0.192965s 0.495157s 0.951721s 59.201408s 13.131805s 28.881310s
11
+ push + pop (rb_heap) 513.523k 736.618k 670.187k 618.157k 579.251k 572.795k 543.648k 423.119k 460.849k 445.235k i/s - 1.399M times in 2.724978s 1.899681s 2.087985s 2.263730s 2.415776s 2.443003s 2.573980s 3.307202s 3.036440s 3.142928s
12
+ push + pop (c++ stl) 3.396M 4.902M 4.794M 4.532M 4.316M 4.204M 3.903M 2.022M 2.659M 2.347M i/s - 9.069M times in 2.670712s 1.850114s 1.891786s 2.001185s 2.101354s 2.157093s 2.323676s 4.484351s 3.410224s 3.864573s
13
+ push + pop (c_dheap) 4.403M 7.311M 6.407M 6.738M 6.254M 5.918M 5.126M 2.138M 3.304M 2.665M i/s - 10.737M times in 2.438365s 1.468580s 1.675785s 1.593589s 1.716764s 1.814447s 2.094553s 5.022305s 3.249709s 4.029170s
15
14
 
16
15
  Comparison:
17
16
  push + pop (findmin)
18
- bin/bench_n 20000: 14130.9 i/s
19
- bin/bench_n 40000: 6039.2 i/s - 2.34x slower
20
- bin/bench_n 60000: 3760.1 i/s - 3.76x slower
21
- bin/bench_n 80000: 2727.5 i/s - 5.18x slower
22
- bin/bench_n 100000: 2136.1 i/s - 6.62x slower
23
- bin/bench_n 120000: 1736.4 i/s - 8.14x slower
24
- bin/bench_n 140000: 1476.9 i/s - 9.57x slower
17
+ bin/bench_n 10000: 11013.7 i/s
18
+ bin/bench_n 25000: 4425.8 i/s - 2.49x slower
19
+ bin/bench_n 50000: 2177.9 i/s - 5.06x slower
20
+ bin/bench_n 100000: 1084.2 i/s - 10.16x slower
21
+ bin/bench_n 250000: 408.7 i/s - 26.95x slower
22
+ bin/bench_n 500000: 215.7 i/s - 51.06x slower
23
+ bin/bench_n 1000000: 136.7 i/s - 80.57x slower
24
+ bin/bench_n 2500000: 52.0 i/s - 211.65x slower
25
+ bin/bench_n 5000000: 26.3 i/s - 418.66x slower
26
+ bin/bench_n 10000000: 13.2 i/s - 836.34x slower
25
27
 
26
28
  push + pop (bsearch)
27
- bin/bench_n 20000: 1543594.7 i/s
28
- bin/bench_n 40000: 1312021.6 i/s - 1.18x slower
29
- bin/bench_n 60000: 1118113.4 i/s - 1.38x slower
30
- bin/bench_n 80000: 877816.6 i/s - 1.76x slower
31
- bin/bench_n 100000: 697831.5 i/s - 2.21x slower
32
- bin/bench_n 120000: 570122.1 i/s - 2.71x slower
33
- bin/bench_n 140000: 459166.2 i/s - 3.36x slower
29
+ bin/bench_n 10000: 786334.2 i/s
30
+ bin/bench_n 25000: 364963.8 i/s - 2.15x slower
31
+ bin/bench_n 50000: 200520.6 i/s - 3.92x slower
32
+ bin/bench_n 100000: 88607.0 i/s - 8.87x slower
33
+ bin/bench_n 250000: 34530.5 i/s - 22.77x slower
34
+ bin/bench_n 500000: 17965.4 i/s - 43.77x slower
35
+ bin/bench_n 1000000: 5638.7 i/s - 139.45x slower
36
+ bin/bench_n 2500000: 1302.0 i/s - 603.93x slower
37
+ bin/bench_n 5000000: 592.0 i/s - 1328.25x slower
38
+ bin/bench_n 10000000: 288.8 i/s - 2722.66x slower
34
39
 
35
40
  push + pop (rb_heap)
36
- bin/bench_n 20000: 539711.6 i/s
37
- bin/bench_n 40000: 512211.7 i/s - 1.05x slower
38
- bin/bench_n 60000: 499451.1 i/s - 1.08x slower
39
- bin/bench_n 120000: 497861.1 i/s - 1.08x slower
40
- bin/bench_n 80000: 484457.5 i/s - 1.11x slower
41
- bin/bench_n 100000: 452216.7 i/s - 1.19x slower
42
- bin/bench_n 140000: 412057.4 i/s - 1.31x slower
41
+ bin/bench_n 10000: 736618.2 i/s
42
+ bin/bench_n 25000: 670186.8 i/s - 1.10x slower
43
+ bin/bench_n 50000: 618156.7 i/s - 1.19x slower
44
+ bin/bench_n 100000: 579250.7 i/s - 1.27x slower
45
+ bin/bench_n 250000: 572795.0 i/s - 1.29x slower
46
+ bin/bench_n 500000: 543648.3 i/s - 1.35x slower
47
+ bin/bench_n 1000000: 513523.4 i/s - 1.43x slower
48
+ bin/bench_n 2500000: 460848.9 i/s - 1.60x slower
49
+ bin/bench_n 5000000: 445234.5 i/s - 1.65x slower
50
+ bin/bench_n 10000000: 423119.0 i/s - 1.74x slower
51
+
52
+ push + pop (c++ stl)
53
+ bin/bench_n 10000: 4901711.5 i/s
54
+ bin/bench_n 25000: 4793735.8 i/s - 1.02x slower
55
+ bin/bench_n 50000: 4531675.9 i/s - 1.08x slower
56
+ bin/bench_n 100000: 4315657.8 i/s - 1.14x slower
57
+ bin/bench_n 250000: 4204141.1 i/s - 1.17x slower
58
+ bin/bench_n 500000: 3902748.9 i/s - 1.26x slower
59
+ bin/bench_n 1000000: 3395620.2 i/s - 1.44x slower
60
+ bin/bench_n 2500000: 2659274.8 i/s - 1.84x slower
61
+ bin/bench_n 5000000: 2346630.0 i/s - 2.09x slower
62
+ bin/bench_n 10000000: 2022304.5 i/s - 2.42x slower
43
63
 
44
64
  push + pop (c_dheap)
45
- bin/bench_n 20000: 3152657.6 i/s
46
- bin/bench_n 80000: 2911843.5 i/s - 1.08x slower
47
- bin/bench_n 60000: 2831204.1 i/s - 1.11x slower
48
- bin/bench_n 40000: 2755984.2 i/s - 1.14x slower
49
- bin/bench_n 140000: 2586616.8 i/s - 1.22x slower
50
- bin/bench_n 120000: 2552399.7 i/s - 1.24x slower
51
- bin/bench_n 100000: 2538628.9 i/s - 1.24x slower
65
+ bin/bench_n 10000: 7311366.6 i/s
66
+ bin/bench_n 50000: 6737824.5 i/s - 1.09x slower
67
+ bin/bench_n 25000: 6407340.6 i/s - 1.14x slower
68
+ bin/bench_n 100000: 6254396.3 i/s - 1.17x slower
69
+ bin/bench_n 250000: 5917684.5 i/s - 1.24x slower
70
+ bin/bench_n 500000: 5126307.6 i/s - 1.43x slower
71
+ bin/bench_n 1000000: 4403494.1 i/s - 1.66x slower
72
+ bin/bench_n 2500000: 3304088.2 i/s - 2.21x slower
73
+ bin/bench_n 5000000: 2664897.7 i/s - 2.74x slower
74
+ bin/bench_n 10000000: 2137927.6 i/s - 3.42x slower
52
75
 
@@ -0,0 +1,39 @@
1
+ Calculating -------------------------------------
2
+ bin/bench_n 10000 bin/bench_n 100000 bin/bench_n 1000000 bin/bench_n 10000000
3
+ push + pop (findmin) 40.280M 42.236M 58.956M 204.536M bytes - 1.000 times
4
+ push + pop (bsearch) 40.212M 42.036M 59.012M 204.536M bytes - 1.000 times
5
+ push + pop (rb_heap) 40.264M 41.780M 58.940M 204.364M bytes - 1.000 times
6
+ push + pop (c++ stl) 40.416M 42.268M 56.624M 302.152M bytes - 1.000 times
7
+ push + pop (c_dheap) 40.848M 43.968M 72.888M 568.828M bytes - 1.000 times
8
+
9
+ Comparison:
10
+ push + pop (findmin)
11
+ bin/bench_n 10000: 40280000.0 bytes
12
+ bin/bench_n 100000: 42236000.0 bytes - 1.05x larger
13
+ bin/bench_n 1000000: 58956000.0 bytes - 1.46x larger
14
+ bin/bench_n 10000000: 204536000.0 bytes - 5.08x larger
15
+
16
+ push + pop (bsearch)
17
+ bin/bench_n 10000: 40212000.0 bytes
18
+ bin/bench_n 100000: 42036000.0 bytes - 1.05x larger
19
+ bin/bench_n 1000000: 59012000.0 bytes - 1.47x larger
20
+ bin/bench_n 10000000: 204536000.0 bytes - 5.09x larger
21
+
22
+ push + pop (rb_heap)
23
+ bin/bench_n 10000: 40264000.0 bytes
24
+ bin/bench_n 100000: 41780000.0 bytes - 1.04x larger
25
+ bin/bench_n 1000000: 58940000.0 bytes - 1.46x larger
26
+ bin/bench_n 10000000: 204364000.0 bytes - 5.08x larger
27
+
28
+ push + pop (c++ stl)
29
+ bin/bench_n 10000: 40416000.0 bytes
30
+ bin/bench_n 100000: 42268000.0 bytes - 1.05x larger
31
+ bin/bench_n 1000000: 56624000.0 bytes - 1.40x larger
32
+ bin/bench_n 10000000: 302152000.0 bytes - 7.48x larger
33
+
34
+ push + pop (c_dheap)
35
+ bin/bench_n 10000: 40848000.0 bytes
36
+ bin/bench_n 100000: 43968000.0 bytes - 1.08x larger
37
+ bin/bench_n 1000000: 72888000.0 bytes - 1.78x larger
38
+ bin/bench_n 10000000: 568828000.0 bytes - 13.93x larger
39
+
@@ -1,5 +1,5 @@
1
- Benchmarking run at 2021-01-11 23:29:03 -0500
2
- ruby v2.7.2, DHeap v0.4.0
1
+ Benchmarking run at 2021-01-17 17:17:24 -0500
2
+ ruby v2.7.2, DHeap v0.5.0
3
3
 
4
4
  ################################################################################
5
5
  # Benchmarks with N=5 (t=10sec/benchmark)
@@ -7,54 +7,63 @@ ruby v2.7.2, DHeap v0.4.0
7
7
 
8
8
  == push N (N=5) ================================================================
9
9
  Warming up --------------------------------------
10
- push N (bsearch) 931.441k i/s - 1.879M times in 2.017047s (1.07μs/i)
11
- push N (rb_heap) 1.012M i/s - 2.029M times in 2.005686s (988.29ns/i)
12
- push N (c_dheap) 1.665M i/s - 3.351M times in 2.012998s (600.72ns/i)
10
+ push N (bsearch) 921.113k i/s - 1.862M times in 2.021033s (1.09μs/i)
11
+ push N (rb_heap) 953.542k i/s - 1.933M times in 2.026956s (1.05μs/i)
12
+ push N (c++ stl) 989.247k i/s - 2.038M times in 2.060495s (1.01μs/i)
13
+ push N (c_dheap) 1.922M i/s - 3.928M times in 2.043907s (520.30ns/i)
13
14
  Calculating -------------------------------------
14
- push N (bsearch) 946.364k i/s - 5.589M times in 5.905389s (1.06μs/i)
15
- push N (rb_heap) 971.614k i/s - 6.071M times in 6.248476s (1.03μs/i)
16
- push N (c_dheap) 1.701M i/s - 9.988M times in 5.870725s (587.77ns/i)
15
+ push N (bsearch) 921.060k i/s - 5.527M times in 6.000346s (1.09μs/i)
16
+ push N (rb_heap) 928.435k i/s - 5.721M times in 6.162252s (1.08μs/i)
17
+ push N (c++ stl) 1.050M i/s - 5.935M times in 5.654249s (952.62ns/i)
18
+ push N (c_dheap) 1.970M i/s - 11.532M times in 5.854595s (507.69ns/i)
17
19
 
18
20
  Comparison:
19
- push N (c_dheap): 1701338.1 i/s
20
- push N (rb_heap): 971614.1 i/s - 1.75x slower
21
- push N (bsearch): 946363.7 i/s - 1.80x slower
21
+ push N (c_dheap): 1969700.7 i/s
22
+ push N (c++ stl): 1049738.1 i/s - 1.88x slower
23
+ push N (rb_heap): 928435.2 i/s - 2.12x slower
24
+ push N (bsearch): 921060.0 i/s - 2.14x slower
22
25
 
23
26
  == push N then pop N (N=5) ====================================================
24
27
  Warming up --------------------------------------
25
- push N + pop N (findmin) 816.694k i/s - 1.656M times in 2.028176s (1.22μs/i)
26
- push N + pop N (bsearch) 770.442k i/s - 1.566M times in 2.032470s (1.30μs/i)
27
- push N + pop N (rb_heap) 467.156k i/s - 971.112k times in 2.078774s (2.14μs/i)
28
- push N + pop N (c_dheap) 1.072M i/s - 2.164M times in 2.018623s (933.02ns/i)
28
+ push N + pop N (findmin) 812.905k i/s - 1.645M times in 2.023946s (1.23μs/i)
29
+ push N + pop N (bsearch) 756.655k i/s - 1.537M times in 2.031407s (1.32μs/i)
30
+ push N + pop N (rb_heap) 505.268k i/s - 1.051M times in 2.079579s (1.98μs/i)
31
+ push N + pop N (c++ stl) 1.159M i/s - 2.358M times in 2.035009s (863.13ns/i)
32
+ push N + pop N (c_dheap) 1.425M i/s - 2.889M times in 2.028016s (701.91ns/i)
29
33
  Calculating -------------------------------------
30
- push N + pop N (findmin) 841.708k i/s - 4.900M times in 5.821693s (1.19μs/i)
31
- push N + pop N (bsearch) 773.253k i/s - 4.623M times in 5.978188s (1.29μs/i)
32
- push N + pop N (rb_heap) 471.853k i/s - 2.803M times in 5.940275s (2.12μs/i)
33
- push N + pop N (c_dheap) 1.088M i/s - 6.431M times in 5.910898s (919.16ns/i)
34
+ push N + pop N (findmin) 862.913k i/s - 4.877M times in 5.652280s (1.16μs/i)
35
+ push N + pop N (bsearch) 762.887k i/s - 4.540M times in 5.950988s (1.31μs/i)
36
+ push N + pop N (rb_heap) 506.890k i/s - 3.032M times in 5.980790s (1.97μs/i)
37
+ push N + pop N (c++ stl) 1.135M i/s - 6.951M times in 6.124666s (881.06ns/i)
38
+ push N + pop N (c_dheap) 1.376M i/s - 8.548M times in 6.213139s (726.85ns/i)
34
39
 
35
40
  Comparison:
36
- push N + pop N (c_dheap): 1087944.8 i/s
37
- push N + pop N (findmin): 841708.1 i/s - 1.29x slower
38
- push N + pop N (bsearch): 773252.7 i/s - 1.41x slower
39
- push N + pop N (rb_heap): 471852.9 i/s - 2.31x slower
41
+ push N + pop N (c_dheap): 1375805.0 i/s
42
+ push N + pop N (c++ stl): 1134997.5 i/s - 1.21x slower
43
+ push N + pop N (findmin): 862913.1 i/s - 1.59x slower
44
+ push N + pop N (bsearch): 762887.1 i/s - 1.80x slower
45
+ push N + pop N (rb_heap): 506890.4 i/s - 2.71x slower
40
46
 
41
47
  == Push/pop with pre-filled queue (size=N) (N=5) ==============================
42
48
  Warming up --------------------------------------
43
- push + pop (findmin) 5.151M i/s - 10.467M times in 2.032075s (194.13ns/i, 464clocks/i)
44
- push + pop (bsearch) 4.021M i/s - 8.148M times in 2.026548s (248.72ns/i, 664clocks/i)
45
- push + pop (rb_heap) 2.158M i/s - 4.445M times in 2.059708s (463.35ns/i)
46
- push + pop (c_dheap) 5.185M i/s - 10.373M times in 2.000519s (192.86ns/i, 483clocks/i)
49
+ push + pop (findmin) 5.115M i/s - 10.399M times in 2.033134s (195.52ns/i, 504clocks/i)
50
+ push + pop (bsearch) 4.203M i/s - 8.569M times in 2.038788s (237.92ns/i, 627clocks/i)
51
+ push + pop (rb_heap) 2.362M i/s - 4.760M times in 2.014718s (423.30ns/i)
52
+ push + pop (c++ stl) 6.881M i/s - 13.910M times in 2.021416s (145.32ns/i, 269clocks/i)
53
+ push + pop (c_dheap) 8.354M i/s - 16.814M times in 2.012796s (119.71ns/i, 343clocks/i)
47
54
  Calculating -------------------------------------
48
- push + pop (findmin) 5.004M i/s - 30.906M times in 6.176454s (199.84ns/i, 413clocks/i)
49
- push + pop (bsearch) 4.321M i/s - 24.124M times in 5.583405s (231.45ns/i, 647clocks/i)
50
- push + pop (rb_heap) 2.207M i/s - 12.949M times in 5.867179s (453.10ns/i)
51
- push + pop (c_dheap) 5.525M i/s - 31.111M times in 5.630456s (180.98ns/i, 458clocks/i)
55
+ push + pop (findmin) 5.026M i/s - 30.687M times in 6.105509s (198.96ns/i, 532clocks/i)
56
+ push + pop (bsearch) 4.300M i/s - 25.219M times in 5.864447s (232.54ns/i, 607clocks/i)
57
+ push + pop (rb_heap) 2.299M i/s - 14.174M times in 6.164105s (434.88ns/i)
58
+ push + pop (c++ stl) 7.535M i/s - 41.288M times in 5.479760s (132.72ns/i, 350clocks/i)
59
+ push + pop (c_dheap) 9.044M i/s - 50.122M times in 5.541698s (110.57ns/i, 241clocks/i)
52
60
 
53
61
  Comparison:
54
- push + pop (c_dheap): 5525418.8 i/s
55
- push + pop (findmin): 5003904.8 i/s - 1.10x slower
56
- push + pop (bsearch): 4320581.8 i/s - 1.28x slower
57
- push + pop (rb_heap): 2207042.0 i/s - 2.50x slower
62
+ push + pop (c_dheap): 9044435.5 i/s
63
+ push + pop (c++ stl): 7534583.4 i/s - 1.20x slower
64
+ push + pop (findmin): 5026155.1 i/s - 1.80x slower
65
+ push + pop (bsearch): 4300260.0 i/s - 2.10x slower
66
+ push + pop (rb_heap): 2299499.7 i/s - 3.93x slower
58
67
 
59
68
  ################################################################################
60
69
  # Benchmarks with N=21 (t=10sec/benchmark)
@@ -62,54 +71,63 @@ push + pop (rb_heap): 2207042.0 i/s - 2.50x slower
62
71
 
63
72
  == push N (N=21) ==============================================================
64
73
  Warming up --------------------------------------
65
- push N (bsearch) 170.251k i/s - 355.419k times in 2.087615s (5.87μs/i)
66
- push N (rb_heap) 212.048k i/s - 442.865k times in 2.088508s (4.72μs/i)
67
- push N (c_dheap) 391.469k i/s - 801.504k times in 2.047426s (2.55μs/i)
74
+ push N (bsearch) 172.478k i/s - 359.942k times in 2.086881s (5.80μs/i)
75
+ push N (rb_heap) 206.237k i/s - 426.074k times in 2.065940s (4.85μs/i)
76
+ push N (c++ stl) 317.575k i/s - 652.828k times in 2.055665s (3.15μs/i)
77
+ push N (c_dheap) 488.947k i/s - 991.484k times in 2.027793s (2.05μs/i)
68
78
  Calculating -------------------------------------
69
- push N (bsearch) 169.583k i/s - 1.022M times in 6.023633s (5.90μs/i)
70
- push N (rb_heap) 212.275k i/s - 1.272M times in 5.993587s (4.71μs/i)
71
- push N (c_dheap) 408.307k i/s - 2.349M times in 5.752569s (2.45μs/i)
79
+ push N (bsearch) 168.679k i/s - 1.035M times in 6.135155s (5.93μs/i)
80
+ push N (rb_heap) 202.804k i/s - 1.237M times in 6.101584s (4.93μs/i)
81
+ push N (c++ stl) 305.547k i/s - 1.905M times in 6.236198s (3.27μs/i)
82
+ push N (c_dheap) 464.231k i/s - 2.934M times in 6.319441s (2.15μs/i)
72
83
 
73
84
  Comparison:
74
- push N (c_dheap): 408307.0 i/s
75
- push N (rb_heap): 212275.2 i/s - 1.92x slower
76
- push N (bsearch): 169583.2 i/s - 2.41x slower
85
+ push N (c_dheap): 464231.4 i/s
86
+ push N (c++ stl): 305546.7 i/s - 1.52x slower
87
+ push N (rb_heap): 202803.7 i/s - 2.29x slower
88
+ push N (bsearch): 168678.7 i/s - 2.75x slower
77
89
 
78
90
  == push N then pop N (N=21) ====================================================
79
91
  Warming up --------------------------------------
80
- push N + pop N (findmin) 166.784k i/s - 344.938k times in 2.068173s (6.00μs/i)
81
- push N + pop N (bsearch) 145.768k i/s - 304.502k times in 2.088957s (6.86μs/i)
82
- push N + pop N (rb_heap) 69.234k i/s - 143.020k times in 2.065750s (14.44μs/i)
83
- push N + pop N (c_dheap) 198.924k i/s - 414.304k times in 2.082722s (5.03μs/i)
92
+ push N + pop N (findmin) 160.307k i/s - 331.191k times in 2.065978s (6.24μs/i)
93
+ push N + pop N (bsearch) 136.665k i/s - 280.830k times in 2.054882s (7.32μs/i)
94
+ push N + pop N (rb_heap) 77.997k i/s - 156.492k times in 2.006388s (12.82μs/i)
95
+ push N + pop N (c++ stl) 243.819k i/s - 489.279k times in 2.006731s (4.10μs/i)
96
+ push N + pop N (c_dheap) 295.254k i/s - 597.410k times in 2.023373s (3.39μs/i)
84
97
  Calculating -------------------------------------
85
- push N + pop N (findmin) 162.025k i/s - 1.001M times in 6.176244s (6.17μs/i)
86
- push N + pop N (bsearch) 146.284k i/s - 874.605k times in 5.978803s (6.84μs/i)
87
- push N + pop N (rb_heap) 72.289k i/s - 415.403k times in 5.746419s (13.83μs/i)
88
- push N + pop N (c_dheap) 199.435k i/s - 1.194M times in 5.984617s (5.01μs/i)
98
+ push N + pop N (findmin) 161.999k i/s - 961.842k times in 5.937343s (6.17μs/i)
99
+ push N + pop N (bsearch) 143.432k i/s - 819.988k times in 5.716901s (6.97μs/i)
100
+ push N + pop N (rb_heap) 79.622k i/s - 467.981k times in 5.877529s (12.56μs/i)
101
+ push N + pop N (c++ stl) 252.227k i/s - 1.463M times in 5.799983s (3.96μs/i)
102
+ push N + pop N (c_dheap) 298.350k i/s - 1.772M times in 5.937739s (3.35μs/i)
89
103
 
90
104
  Comparison:
91
- push N + pop N (c_dheap): 199435.5 i/s
92
- push N + pop N (findmin): 162024.5 i/s - 1.23x slower
93
- push N + pop N (bsearch): 146284.3 i/s - 1.36x slower
94
- push N + pop N (rb_heap): 72289.0 i/s - 2.76x slower
105
+ push N + pop N (c_dheap): 298350.3 i/s
106
+ push N + pop N (c++ stl): 252227.1 i/s - 1.18x slower
107
+ push N + pop N (findmin): 161998.7 i/s - 1.84x slower
108
+ push N + pop N (bsearch): 143432.3 i/s - 2.08x slower
109
+ push N + pop N (rb_heap): 79622.1 i/s - 3.75x slower
95
110
 
96
111
  == Push/pop with pre-filled queue (size=N) (N=21) ==============================
97
112
  Warming up --------------------------------------
98
- push + pop (findmin) 4.230M i/s - 8.548M times in 2.020984s (236.43ns/i, 633clocks/i)
99
- push + pop (bsearch) 3.257M i/s - 6.630M times in 2.035714s (307.06ns/i, 669clocks/i)
100
- push + pop (rb_heap) 1.544M i/s - 3.159M times in 2.045247s (647.47ns/i)
101
- push + pop (c_dheap) 4.705M i/s - 9.501M times in 2.019236s (212.53ns/i, 533clocks/i)
113
+ push + pop (findmin) 4.383M i/s - 8.832M times in 2.014937s (228.13ns/i, 482clocks/i)
114
+ push + pop (bsearch) 3.357M i/s - 6.859M times in 2.042965s (297.84ns/i, 709clocks/i)
115
+ push + pop (rb_heap) 1.885M i/s - 3.852M times in 2.043333s (530.48ns/i, 698clocks/i)
116
+ push + pop (c++ stl) 6.362M i/s - 12.844M times in 2.018810s (157.18ns/i, 438clocks/i)
117
+ push + pop (c_dheap) 7.644M i/s - 15.337M times in 2.006451s (130.83ns/i, 350clocks/i)
102
118
  Calculating -------------------------------------
103
- push + pop (findmin) 4.467M i/s - 25.378M times in 5.680532s (223.84ns/i, 551clocks/i)
104
- push + pop (bsearch) 3.345M i/s - 19.540M times in 5.840823s (298.91ns/i, 831clocks/i)
105
- push + pop (rb_heap) 1.560M i/s - 9.267M times in 5.938451s (640.83ns/i)
106
- push + pop (c_dheap) 4.837M i/s - 28.231M times in 5.836574s (206.75ns/i, 591clocks/i)
119
+ push + pop (findmin) 4.543M i/s - 26.301M times in 5.789445s (220.12ns/i, 618clocks/i)
120
+ push + pop (bsearch) 3.462M i/s - 20.145M times in 5.819157s (288.87ns/i, 721clocks/i)
121
+ push + pop (rb_heap) 1.845M i/s - 11.310M times in 6.128707s (541.86ns/i)
122
+ push + pop (c++ stl) 7.223M i/s - 38.172M times in 5.284687s (138.45ns/i, 383clocks/i)
123
+ push + pop (c_dheap) 8.855M i/s - 45.863M times in 5.179255s (112.93ns/i, 331clocks/i)
107
124
 
108
125
  Comparison:
109
- push + pop (c_dheap): 4836860.0 i/s
110
- push + pop (findmin): 4467453.9 i/s - 1.08x slower
111
- push + pop (bsearch): 3345458.4 i/s - 1.45x slower
112
- push + pop (rb_heap): 1560476.3 i/s - 3.10x slower
126
+ push + pop (c_dheap): 8855093.4 i/s
127
+ push + pop (c++ stl): 7223079.5 i/s - 1.23x slower
128
+ push + pop (findmin): 4542913.7 i/s - 1.95x slower
129
+ push + pop (bsearch): 3461802.4 i/s - 2.56x slower
130
+ push + pop (rb_heap): 1845488.7 i/s - 4.80x slower
113
131
 
114
132
  ################################################################################
115
133
  # Benchmarks with N=85 (t=10sec/benchmark)
@@ -117,54 +135,63 @@ push + pop (rb_heap): 1560476.3 i/s - 3.10x slower
117
135
 
118
136
  == push N (N=85) ==============================================================
119
137
  Warming up --------------------------------------
120
- push N (bsearch) 33.491k i/s - 69.846k times in 2.085516s (29.86μs/i)
121
- push N (rb_heap) 43.880k i/s - 91.665k times in 2.089004s (22.79μs/i)
122
- push N (c_dheap) 93.190k i/s - 193.557k times in 2.077020s (10.73μs/i)
138
+ push N (bsearch) 33.725k i/s - 70.434k times in 2.088480s (29.65μs/i)
139
+ push N (rb_heap) 48.257k i/s - 97.041k times in 2.010935s (20.72μs/i)
140
+ push N (c++ stl) 89.473k i/s - 179.991k times in 2.011685s (11.18μs/i)
141
+ push N (c_dheap) 113.625k i/s - 229.362k times in 2.018582s (8.80μs/i)
123
142
  Calculating -------------------------------------
124
- push N (bsearch) 33.118k i/s - 200.945k times in 6.067575s (30.20μs/i)
125
- push N (rb_heap) 47.069k i/s - 263.278k times in 5.593458s (21.25μs/i)
126
- push N (c_dheap) 96.077k i/s - 559.138k times in 5.819670s (10.41μs/i)
143
+ push N (bsearch) 32.896k i/s - 202.350k times in 6.151202s (30.40μs/i)
144
+ push N (rb_heap) 45.078k i/s - 289.539k times in 6.423085s (22.18μs/i)
145
+ push N (c++ stl) 90.436k i/s - 536.836k times in 5.936116s (11.06μs/i)
146
+ push N (c_dheap) 115.218k i/s - 681.751k times in 5.917030s (8.68μs/i)
127
147
 
128
148
  Comparison:
129
- push N (c_dheap): 96077.3 i/s
130
- push N (rb_heap): 47068.9 i/s - 2.04x slower
131
- push N (bsearch): 33117.8 i/s - 2.90x slower
149
+ push N (c_dheap): 115218.4 i/s
150
+ push N (c++ stl): 90435.6 i/s - 1.27x slower
151
+ push N (rb_heap): 45077.9 i/s - 2.56x slower
152
+ push N (bsearch): 32896.0 i/s - 3.50x slower
132
153
 
133
154
  == push N then pop N (N=85) ====================================================
134
155
  Warming up --------------------------------------
135
- push N + pop N (findmin) 27.530k i/s - 57.351k times in 2.083246s (36.32μs/i)
136
- push N + pop N (bsearch) 29.264k i/s - 59.283k times in 2.025786s (34.17μs/i)
137
- push N + pop N (rb_heap) 13.281k i/s - 27.783k times in 2.091902s (75.29μs/i)
138
- push N + pop N (c_dheap) 42.532k i/s - 87.318k times in 2.052993s (23.51μs/i)
156
+ push N + pop N (findmin) 28.014k i/s - 57.855k times in 2.065181s (35.70μs/i)
157
+ push N + pop N (bsearch) 28.759k i/s - 59.829k times in 2.080345s (34.77μs/i)
158
+ push N + pop N (rb_heap) 14.748k i/s - 29.500k times in 2.000302s (67.81μs/i)
159
+ push N + pop N (c++ stl) 58.058k i/s - 117.831k times in 2.029553s (17.22μs/i)
160
+ push N + pop N (c_dheap) 67.639k i/s - 139.587k times in 2.063705s (14.78μs/i)
139
161
  Calculating -------------------------------------
140
- push N + pop N (findmin) 27.615k i/s - 165.177k times in 5.981465s (36.21μs/i)
141
- push N + pop N (bsearch) 29.643k i/s - 175.585k times in 5.923305s (33.73μs/i)
142
- push N + pop N (rb_heap) 13.267k i/s - 79.687k times in 6.006463s (75.38μs/i)
143
- push N + pop N (c_dheap) 41.943k i/s - 255.192k times in 6.084224s (23.84μs/i)
162
+ push N + pop N (findmin) 27.713k i/s - 168.086k times in 6.065197s (36.08μs/i)
163
+ push N + pop N (bsearch) 29.110k i/s - 172.554k times in 5.927752s (34.35μs/i)
164
+ push N + pop N (rb_heap) 14.908k i/s - 88.486k times in 5.935373s (67.08μs/i)
165
+ push N + pop N (c++ stl) 54.774k i/s - 348.345k times in 6.359716s (18.26μs/i)
166
+ push N + pop N (c_dheap) 68.487k i/s - 405.834k times in 5.925729s (14.60μs/i)
144
167
 
145
168
  Comparison:
146
- push N + pop N (c_dheap): 41943.2 i/s
147
- push N + pop N (bsearch): 29643.1 i/s - 1.41x slower
148
- push N + pop N (findmin): 27614.8 i/s - 1.52x slower
149
- push N + pop N (rb_heap): 13266.9 i/s - 3.16x slower
169
+ push N + pop N (c_dheap): 68486.8 i/s
170
+ push N + pop N (c++ stl): 54773.7 i/s - 1.25x slower
171
+ push N + pop N (bsearch): 29109.5 i/s - 2.35x slower
172
+ push N + pop N (findmin): 27713.2 i/s - 2.47x slower
173
+ push N + pop N (rb_heap): 14908.2 i/s - 4.59x slower
150
174
 
151
175
  == Push/pop with pre-filled queue (size=N) (N=85) ==============================
152
176
  Warming up --------------------------------------
153
- push + pop (findmin) 3.070M i/s - 6.171M times in 2.009864s (325.70ns/i, 854clocks/i)
154
- push + pop (bsearch) 2.693M i/s - 5.458M times in 2.026866s (371.36ns/i)
155
- push + pop (rb_heap) 1.285M i/s - 2.598M times in 2.021618s (778.13ns/i)
156
- push + pop (c_dheap) 4.250M i/s - 8.596M times in 2.022749s (235.30ns/i, 676clocks/i)
177
+ push + pop (findmin) 3.148M i/s - 6.329M times in 2.010240s (317.64ns/i, 872clocks/i)
178
+ push + pop (bsearch) 2.616M i/s - 5.241M times in 2.003260s (382.20ns/i)
179
+ push + pop (rb_heap) 1.537M i/s - 3.126M times in 2.033793s (650.57ns/i)
180
+ push + pop (c++ stl) 6.648M i/s - 13.314M times in 2.002850s (150.43ns/i, 396clocks/i)
181
+ push + pop (c_dheap) 7.902M i/s - 15.885M times in 2.010277s (126.55ns/i, 282clocks/i)
157
182
  Calculating -------------------------------------
158
- push + pop (findmin) 3.221M i/s - 18.422M times in 5.719316s (310.46ns/i, 843clocks/i)
159
- push + pop (bsearch) 2.721M i/s - 16.157M times in 5.937334s (367.48ns/i, 815clocks/i)
160
- push + pop (rb_heap) 1.219M i/s - 7.711M times in 6.326403s (820.46ns/i)
161
- push + pop (c_dheap) 4.309M i/s - 25.499M times in 5.917551s (232.07ns/i, 615clocks/i)
183
+ push + pop (findmin) 3.327M i/s - 18.889M times in 5.677677s (300.58ns/i, 809clocks/i)
184
+ push + pop (bsearch) 2.827M i/s - 15.699M times in 5.553113s (353.73ns/i, 891clocks/i)
185
+ push + pop (rb_heap) 1.465M i/s - 9.223M times in 6.293793s (682.42ns/i)
186
+ push + pop (c++ stl) 7.057M i/s - 39.885M times in 5.651789s (141.70ns/i, 418clocks/i)
187
+ push + pop (c_dheap) 8.422M i/s - 47.412M times in 5.629438s (118.73ns/i, 281clocks/i)
162
188
 
163
189
  Comparison:
164
- push + pop (c_dheap): 4309094.2 i/s
165
- push + pop (findmin): 3221024.5 i/s - 1.34x slower
166
- push + pop (bsearch): 2721221.4 i/s - 1.58x slower
167
- push + pop (rb_heap): 1218828.1 i/s - 3.54x slower
190
+ push + pop (c_dheap): 8422216.3 i/s
191
+ push + pop (c++ stl): 7057057.1 i/s - 1.19x slower
192
+ push + pop (findmin): 3326922.6 i/s - 2.53x slower
193
+ push + pop (bsearch): 2827025.2 i/s - 2.98x slower
194
+ push + pop (rb_heap): 1465369.7 i/s - 5.75x slower
168
195
 
169
196
  ################################################################################
170
197
  # Benchmarks with N=341 (t=10sec/benchmark)
@@ -172,54 +199,63 @@ push + pop (rb_heap): 1218828.1 i/s - 3.54x slower
172
199
 
173
200
  == push N (N=341) ==============================================================
174
201
  Warming up --------------------------------------
175
- push N (bsearch) 6.749k i/s - 13.500k times in 2.000413s (148.18μs/i)
176
- push N (rb_heap) 11.089k i/s - 23.142k times in 2.086845s (90.18μs/i)
177
- push N (c_dheap) 24.122k i/s - 50.652k times in 2.099804s (41.46μs/i)
202
+ push N (bsearch) 6.761k i/s - 13.860k times in 2.049946s (147.90μs/i)
203
+ push N (rb_heap) 11.284k i/s - 23.040k times in 2.041838s (88.62μs/i)
204
+ push N (c++ stl) 23.839k i/s - 49.266k times in 2.066605s (41.95μs/i)
205
+ push N (c_dheap) 30.654k i/s - 63.420k times in 2.068901s (32.62μs/i)
178
206
  Calculating -------------------------------------
179
- push N (bsearch) 6.480k i/s - 40.491k times in 6.248994s (154.33μs/i)
180
- push N (rb_heap) 11.533k i/s - 66.536k times in 5.769108s (86.71μs/i)
181
- push N (c_dheap) 24.443k i/s - 144.733k times in 5.921130s (40.91μs/i)
207
+ push N (bsearch) 6.624k i/s - 40.566k times in 6.123861s (150.96μs/i)
208
+ push N (rb_heap) 11.433k i/s - 67.703k times in 5.921638s (87.46μs/i)
209
+ push N (c++ stl) 23.055k i/s - 143.034k times in 6.204083s (43.37μs/i)
210
+ push N (c_dheap) 27.951k i/s - 183.923k times in 6.580153s (35.78μs/i)
182
211
 
183
212
  Comparison:
184
- push N (c_dheap): 24443.5 i/s
185
- push N (rb_heap): 11533.2 i/s - 2.12x slower
186
- push N (bsearch): 6479.6 i/s - 3.77x slower
213
+ push N (c_dheap): 27951.2 i/s
214
+ push N (c++ stl): 23054.8 i/s - 1.21x slower
215
+ push N (rb_heap): 11433.2 i/s - 2.44x slower
216
+ push N (bsearch): 6624.3 i/s - 4.22x slower
187
217
 
188
218
  == push N then pop N (N=341) ==================================================
189
219
  Warming up --------------------------------------
190
- push N + pop N (findmin) 3.022k i/s - 6.100k times in 2.018293s (330.87μs/i)
191
- push N + pop N (bsearch) 5.731k i/s - 11.660k times in 2.034429s (174.48μs/i)
192
- push N + pop N (rb_heap) 2.587k i/s - 5.200k times in 2.009894s (386.52μs/i)
193
- push N + pop N (c_dheap) 9.199k i/s - 19.341k times in 2.102558s (108.71μs/i)
220
+ push N + pop N (findmin) 3.013k i/s - 6.040k times in 2.004514s (331.87μs/i)
221
+ push N + pop N (bsearch) 6.202k i/s - 12.684k times in 2.045306s (161.25μs/i)
222
+ push N + pop N (rb_heap) 3.028k i/s - 6.100k times in 2.014435s (330.24μs/i)
223
+ push N + pop N (c++ stl) 13.177k i/s - 27.006k times in 2.049544s (75.89μs/i)
224
+ push N + pop N (c_dheap) 15.142k i/s - 31.563k times in 2.084497s (66.04μs/i)
194
225
  Calculating -------------------------------------
195
- push N + pop N (findmin) 2.987k i/s - 18.134k times in 6.070835s (334.78μs/i)
196
- push N + pop N (bsearch) 6.084k i/s - 34.388k times in 5.651801s (164.35μs/i)
197
- push N + pop N (rb_heap) 2.485k i/s - 15.523k times in 6.246007s (402.37μs/i)
198
- push N + pop N (c_dheap) 9.378k i/s - 55.192k times in 5.885032s (106.63μs/i)
226
+ push N + pop N (findmin) 3.025k i/s - 18.079k times in 5.976274s (330.56μs/i)
227
+ push N + pop N (bsearch) 5.906k i/s - 37.209k times in 6.300596s (169.33μs/i)
228
+ push N + pop N (rb_heap) 3.008k i/s - 18.168k times in 6.039305s (332.41μs/i)
229
+ push N + pop N (c++ stl) 13.135k i/s - 79.059k times in 6.018814s (76.13μs/i)
230
+ push N + pop N (c_dheap) 15.142k i/s - 90.850k times in 5.999735s (66.04μs/i)
199
231
 
200
232
  Comparison:
201
- push N + pop N (c_dheap): 9378.4 i/s
202
- push N + pop N (bsearch): 6084.4 i/s - 1.54x slower
203
- push N + pop N (findmin): 2987.1 i/s - 3.14x slower
204
- push N + pop N (rb_heap): 2485.3 i/s - 3.77x slower
233
+ push N + pop N (c_dheap): 15142.3 i/s
234
+ push N + pop N (c++ stl): 13135.3 i/s - 1.15x slower
235
+ push N + pop N (bsearch): 5905.6 i/s - 2.56x slower
236
+ push N + pop N (findmin): 3025.1 i/s - 5.01x slower
237
+ push N + pop N (rb_heap): 3008.3 i/s - 5.03x slower
205
238
 
206
239
  == Push/pop with pre-filled queue (size=N) (N=341) ============================
207
240
  Warming up --------------------------------------
208
- push + pop (findmin) 1.521M i/s - 3.136M times in 2.061814s (657.42ns/i)
209
- push + pop (bsearch) 2.204M i/s - 4.426M times in 2.007702s (453.65ns/i)
210
- push + pop (rb_heap) 979.272k i/s - 2.030M times in 2.073290s (1.02μs/i)
211
- push + pop (c_dheap) 3.709M i/s - 7.536M times in 2.031644s (269.60ns/i, 700clocks/i)
241
+ push + pop (findmin) 1.508M i/s - 3.048M times in 2.020819s (662.94ns/i)
242
+ push + pop (bsearch) 2.149M i/s - 4.337M times in 2.017794s (465.25ns/i)
243
+ push + pop (rb_heap) 1.144M i/s - 2.313M times in 2.021027s (873.78ns/i)
244
+ push + pop (c++ stl) 5.897M i/s - 11.981M times in 2.031688s (169.57ns/i, 484clocks/i)
245
+ push + pop (c_dheap) 7.452M i/s - 14.981M times in 2.010401s (134.20ns/i, 367clocks/i)
212
246
  Calculating -------------------------------------
213
- push + pop (findmin) 1.546M i/s - 9.127M times in 5.904088s (646.91ns/i)
214
- push + pop (bsearch) 2.183M i/s - 13.226M times in 6.058119s (458.04ns/i)
215
- push + pop (rb_heap) 973.052k i/s - 5.876M times in 6.038353s (1.03μs/i)
216
- push + pop (c_dheap) 3.896M i/s - 22.255M times in 5.712835s (256.69ns/i, 748clocks/i)
247
+ push + pop (findmin) 1.548M i/s - 9.051M times in 5.844950s (645.81ns/i)
248
+ push + pop (bsearch) 2.257M i/s - 12.896M times in 5.713856s (443.06ns/i)
249
+ push + pop (rb_heap) 1.220M i/s - 6.867M times in 5.628146s (819.63ns/i)
250
+ push + pop (c++ stl) 6.578M i/s - 35.384M times in 5.379298s (152.03ns/i, 399clocks/i)
251
+ push + pop (c_dheap) 8.225M i/s - 44.711M times in 5.435966s (121.58ns/i, 327clocks/i)
217
252
 
218
253
  Comparison:
219
- push + pop (c_dheap): 3895683.1 i/s
220
- push + pop (bsearch): 2183202.6 i/s - 1.78x slower
221
- push + pop (findmin): 1545816.8 i/s - 2.52x slower
222
- push + pop (rb_heap): 973051.6 i/s - 4.00x slower
254
+ push + pop (c_dheap): 8225038.0 i/s
255
+ push + pop (c++ stl): 6577756.8 i/s - 1.25x slower
256
+ push + pop (bsearch): 2257028.3 i/s - 3.64x slower
257
+ push + pop (findmin): 1548450.8 i/s - 5.31x slower
258
+ push + pop (rb_heap): 1220067.2 i/s - 6.74x slower
223
259
 
224
260
  ################################################################################
225
261
  # Benchmarks with N=1365 (t=10sec/benchmark)
@@ -227,54 +263,63 @@ push + pop (rb_heap): 973051.6 i/s - 4.00x slower
227
263
 
228
264
  == push N (N=1365) ============================================================
229
265
  Warming up --------------------------------------
230
- push N (bsearch) 1.371k i/s - 2.800k times in 2.041823s (729.22μs/i)
231
- push N (rb_heap) 2.863k i/s - 6.006k times in 2.097685s (349.26μs/i)
232
- push N (c_dheap) 5.730k i/s - 11.840k times in 2.066292s (174.52μs/i)
266
+ push N (bsearch) 1.394k i/s - 2.898k times in 2.079633s (717.61μs/i)
267
+ push N (rb_heap) 2.943k i/s - 5.920k times in 2.011565s (339.79μs/i)
268
+ push N (c++ stl) 5.621k i/s - 11.676k times in 2.077224s (177.91μs/i)
269
+ push N (c_dheap) 7.425k i/s - 15.582k times in 2.098509s (134.68μs/i)
233
270
  Calculating -------------------------------------
234
- push N (bsearch) 1.362k i/s - 8.227k times in 6.041325s (734.33μs/i)
235
- push N (rb_heap) 2.615k i/s - 17.178k times in 6.568916s (382.40μs/i)
236
- push N (c_dheap) 5.775k i/s - 34.380k times in 5.953356s (173.16μs/i)
271
+ push N (bsearch) 1.346k i/s - 8.361k times in 6.211667s (742.93μs/i)
272
+ push N (rb_heap) 2.908k i/s - 17.657k times in 6.072601s (343.92μs/i)
273
+ push N (c++ stl) 5.812k i/s - 33.725k times in 5.802474s (172.05μs/i)
274
+ push N (c_dheap) 7.406k i/s - 44.551k times in 6.015756s (135.03μs/i)
237
275
 
238
276
  Comparison:
239
- push N (c_dheap): 5774.9 i/s
240
- push N (rb_heap): 2615.0 i/s - 2.21x slower
241
- push N (bsearch): 1361.8 i/s - 4.24x slower
277
+ push N (c_dheap): 7405.7 i/s
278
+ push N (c++ stl): 5812.2 i/s - 1.27x slower
279
+ push N (rb_heap): 2907.7 i/s - 2.55x slower
280
+ push N (bsearch): 1346.0 i/s - 5.50x slower
242
281
 
243
282
  == push N then pop N (N=1365) ==================================================
244
283
  Warming up --------------------------------------
245
- push N + pop N (findmin) 196.660 i/s - 400.000 times in 2.033965s (5.08ms/i)
246
- push N + pop N (bsearch) 1.197k i/s - 2.457k times in 2.052435s (835.34μs/i)
247
- push N + pop N (rb_heap) 539.093 i/s - 1.080k times in 2.003367s (1.85ms/i)
248
- push N + pop N (c_dheap) 2.012k i/s - 4.158k times in 2.066145s (496.91μs/i)
284
+ push N + pop N (findmin) 189.039 i/s - 380.000 times in 2.010168s (5.29ms/i)
285
+ push N + pop N (bsearch) 1.275k i/s - 2.667k times in 2.091317s (784.15μs/i)
286
+ push N + pop N (rb_heap) 629.327 i/s - 1.260k times in 2.002137s (1.59ms/i)
287
+ push N + pop N (c++ stl) 3.083k i/s - 6.280k times in 2.036843s (324.34μs/i)
288
+ push N + pop N (c_dheap) 3.434k i/s - 6.880k times in 2.003496s (291.21μs/i)
249
289
  Calculating -------------------------------------
250
- push N + pop N (findmin) 193.288 i/s - 1.179k times in 6.099704s (5.17ms/i)
251
- push N + pop N (bsearch) 1.282k i/s - 7.182k times in 5.602801s (780.12μs/i)
252
- push N + pop N (rb_heap) 528.397 i/s - 3.234k times in 6.120397s (1.89ms/i)
253
- push N + pop N (c_dheap) 2.073k i/s - 12.074k times in 5.824461s (482.40μs/i)
290
+ push N + pop N (findmin) 195.665 i/s - 1.134k times in 5.795620s (5.11ms/i)
291
+ push N + pop N (bsearch) 1.177k i/s - 7.651k times in 6.501332s (849.74μs/i)
292
+ push N + pop N (rb_heap) 624.066 i/s - 3.775k times in 6.049040s (1.60ms/i)
293
+ push N + pop N (c++ stl) 3.105k i/s - 18.499k times in 5.958037s (322.07μs/i)
294
+ push N + pop N (c_dheap) 3.475k i/s - 20.603k times in 5.928992s (287.77μs/i)
254
295
 
255
296
  Comparison:
256
- push N + pop N (c_dheap): 2073.0 i/s
257
- push N + pop N (bsearch): 1281.9 i/s - 1.62x slower
258
- push N + pop N (rb_heap): 528.4 i/s - 3.92x slower
259
- push N + pop N (findmin): 193.3 i/s - 10.72x slower
297
+ push N + pop N (c_dheap): 3475.0 i/s
298
+ push N + pop N (c++ stl): 3104.9 i/s - 1.12x slower
299
+ push N + pop N (bsearch): 1176.8 i/s - 2.95x slower
300
+ push N + pop N (rb_heap): 624.1 i/s - 5.57x slower
301
+ push N + pop N (findmin): 195.7 i/s - 17.76x slower
260
302
 
261
303
  == Push/pop with pre-filled queue (size=N) (N=1365) ============================
262
304
  Warming up --------------------------------------
263
- push + pop (findmin) 493.933k i/s - 1.023M times in 2.071688s (2.02μs/i)
264
- push + pop (bsearch) 1.972M i/s - 3.978M times in 2.017663s (507.20ns/i)
265
- push + pop (rb_heap) 813.919k i/s - 1.646M times in 2.021751s (1.23μs/i)
266
- push + pop (c_dheap) 2.969M i/s - 6.033M times in 2.032182s (336.83ns/i, 846clocks/i)
305
+ push + pop (findmin) 496.816k i/s - 1.028M times in 2.069729s (2.01μs/i)
306
+ push + pop (bsearch) 1.964M i/s - 3.956M times in 2.014551s (509.28ns/i)
307
+ push + pop (rb_heap) 1.043M i/s - 2.150M times in 2.061288s (958.58ns/i)
308
+ push + pop (c++ stl) 5.289M i/s - 10.720M times in 2.026911s (189.07ns/i, 346clocks/i)
309
+ push + pop (c_dheap) 6.890M i/s - 13.979M times in 2.029039s (145.15ns/i, 411clocks/i)
267
310
  Calculating -------------------------------------
268
- push + pop (findmin) 493.104k i/s - 2.964M times in 6.010080s (2.03μs/i)
269
- push + pop (bsearch) 2.002M i/s - 11.830M times in 5.908100s (499.43ns/i)
270
- push + pop (rb_heap) 831.926k i/s - 4.884M times in 5.870129s (1.20μs/i)
271
- push + pop (c_dheap) 3.117M i/s - 17.813M times in 5.714019s (320.77ns/i, 787clocks/i)
311
+ push + pop (findmin) 498.357k i/s - 2.981M times in 5.981452s (2.01μs/i)
312
+ push + pop (bsearch) 2.016M i/s - 11.781M times in 5.844338s (496.07ns/i)
313
+ push + pop (rb_heap) 1.056M i/s - 6.259M times in 5.926221s (946.80ns/i)
314
+ push + pop (c++ stl) 6.149M i/s - 31.734M times in 5.160646s (162.62ns/i, 357clocks/i)
315
+ push + pop (c_dheap) 7.240M i/s - 41.337M times in 5.709252s (138.11ns/i, 365clocks/i)
272
316
 
273
317
  Comparison:
274
- push + pop (c_dheap): 3117453.6 i/s
275
- push + pop (bsearch): 2002296.0 i/s - 1.56x slower
276
- push + pop (rb_heap): 831926.4 i/s - 3.75x slower
277
- push + pop (findmin): 493104.4 i/s - 6.32x slower
318
+ push + pop (c_dheap): 7240436.4 i/s
319
+ push + pop (c++ stl): 6149299.4 i/s - 1.18x slower
320
+ push + pop (bsearch): 2015850.6 i/s - 3.59x slower
321
+ push + pop (rb_heap): 1056192.6 i/s - 6.86x slower
322
+ push + pop (findmin): 498356.6 i/s - 14.53x slower
278
323
 
279
324
  ################################################################################
280
325
  # Benchmarks with N=5461 (t=10sec/benchmark)
@@ -282,54 +327,63 @@ push + pop (findmin): 493104.4 i/s - 6.32x slower
282
327
 
283
328
  == push N (N=5461) ============================================================
284
329
  Warming up --------------------------------------
285
- push N (bsearch) 271.804 i/s - 567.000 times in 2.086065s (3.68ms/i)
286
- push N (rb_heap) 708.260 i/s - 1.440k times in 2.033152s (1.41ms/i)
287
- push N (c_dheap) 1.523k i/s - 3.171k times in 2.082653s (656.78μs/i)
330
+ push N (bsearch) 269.520 i/s - 560.000 times in 2.077767s (3.71ms/i)
331
+ push N (rb_heap) 717.703 i/s - 1.440k times in 2.006402s (1.39ms/i)
332
+ push N (c++ stl) 1.462k i/s - 3.045k times in 2.082734s (683.99μs/i)
333
+ push N (c_dheap) 1.823k i/s - 3.780k times in 2.073303s (548.49μs/i)
288
334
  Calculating -------------------------------------
289
- push N (bsearch) 268.014 i/s - 1.630k times in 6.081766s (3.73ms/i)
290
- push N (rb_heap) 682.522 i/s - 4.249k times in 6.225438s (1.47ms/i)
291
- push N (c_dheap) 1.494k i/s - 9.135k times in 6.113865s (669.28μs/i)
335
+ push N (bsearch) 258.932 i/s - 1.617k times in 6.244873s (3.86ms/i)
336
+ push N (rb_heap) 723.029 i/s - 4.306k times in 5.955502s (1.38ms/i)
337
+ push N (c++ stl) 1.407k i/s - 8.772k times in 6.235747s (710.87μs/i)
338
+ push N (c_dheap) 1.853k i/s - 10.939k times in 5.904004s (539.72μs/i)
292
339
 
293
340
  Comparison:
294
- push N (c_dheap): 1494.1 i/s
295
- push N (rb_heap): 682.5 i/s - 2.19x slower
296
- push N (bsearch): 268.0 i/s - 5.57x slower
341
+ push N (c_dheap): 1852.8 i/s
342
+ push N (c++ stl): 1406.7 i/s - 1.32x slower
343
+ push N (rb_heap): 723.0 i/s - 2.56x slower
344
+ push N (bsearch): 258.9 i/s - 7.16x slower
297
345
 
298
346
  == push N then pop N (N=5461) ==================================================
299
347
  Warming up --------------------------------------
300
- push N + pop N (findmin) 12.484 i/s - 26.000 times in 2.082741s (80.11ms/i)
301
- push N + pop N (bsearch) 250.220 i/s - 520.000 times in 2.078172s (4.00ms/i)
302
- push N + pop N (rb_heap) 115.535 i/s - 240.000 times in 2.077301s (8.66ms/i)
303
- push N + pop N (c_dheap) 454.895 i/s - 920.000 times in 2.022444s (2.20ms/i)
348
+ push N + pop N (findmin) 12.207 i/s - 26.000 times in 2.129850s (81.92ms/i)
349
+ push N + pop N (bsearch) 251.139 i/s - 525.000 times in 2.090473s (3.98ms/i)
350
+ push N + pop N (rb_heap) 137.157 i/s - 280.000 times in 2.041453s (7.29ms/i)
351
+ push N + pop N (c++ stl) 724.325 i/s - 1.460k times in 2.015670s (1.38ms/i)
352
+ push N + pop N (c_dheap) 794.655 i/s - 1.600k times in 2.013452s (1.26ms/i)
304
353
  Calculating -------------------------------------
305
- push N + pop N (findmin) 12.423 i/s - 74.000 times in 5.956886s (80.50ms/i)
306
- push N + pop N (bsearch) 247.409 i/s - 1.501k times in 6.066870s (4.04ms/i)
307
- push N + pop N (rb_heap) 112.159 i/s - 693.000 times in 6.178754s (8.92ms/i)
308
- push N + pop N (c_dheap) 452.913 i/s - 2.729k times in 6.025436s (2.21ms/i)
354
+ push N + pop N (findmin) 12.381 i/s - 73.000 times in 5.896102s (80.77ms/i)
355
+ push N + pop N (bsearch) 249.090 i/s - 1.506k times in 6.046014s (4.01ms/i)
356
+ push N + pop N (rb_heap) 136.820 i/s - 822.000 times in 6.007880s (7.31ms/i)
357
+ push N + pop N (c++ stl) 699.853 i/s - 4.345k times in 6.208445s (1.43ms/i)
358
+ push N + pop N (c_dheap) 779.676 i/s - 4.767k times in 6.114082s (1.28ms/i)
309
359
 
310
360
  Comparison:
311
- push N + pop N (c_dheap): 452.9 i/s
312
- push N + pop N (bsearch): 247.4 i/s - 1.83x slower
313
- push N + pop N (rb_heap): 112.2 i/s - 4.04x slower
314
- push N + pop N (findmin): 12.4 i/s - 36.46x slower
361
+ push N + pop N (c_dheap): 779.7 i/s
362
+ push N + pop N (c++ stl): 699.9 i/s - 1.11x slower
363
+ push N + pop N (bsearch): 249.1 i/s - 3.13x slower
364
+ push N + pop N (rb_heap): 136.8 i/s - 5.70x slower
365
+ push N + pop N (findmin): 12.4 i/s - 62.97x slower
315
366
 
316
367
  == Push/pop with pre-filled queue (size=N) (N=5461) ============================
317
368
  Warming up --------------------------------------
318
- push + pop (findmin) 124.542k i/s - 250.908k times in 2.014649s (8.03μs/i)
319
- push + pop (bsearch) 1.610M i/s - 3.242M times in 2.013150s (620.93ns/i)
320
- push + pop (rb_heap) 704.201k i/s - 1.416M times in 2.010517s (1.42μs/i)
321
- push + pop (c_dheap) 2.563M i/s - 5.170M times in 2.017119s (390.19ns/i)
369
+ push + pop (findmin) 122.350k i/s - 245.280k times in 2.004736s (8.17μs/i)
370
+ push + pop (bsearch) 1.778M i/s - 3.633M times in 2.043729s (562.57ns/i)
371
+ push + pop (rb_heap) 918.753k i/s - 1.850M times in 2.013237s (1.09μs/i)
372
+ push + pop (c++ stl) 5.000M i/s - 10.088M times in 2.017440s (199.99ns/i, 445clocks/i)
373
+ push + pop (c_dheap) 6.520M i/s - 13.190M times in 2.023137s (153.39ns/i, 427clocks/i)
322
374
  Calculating -------------------------------------
323
- push + pop (findmin) 122.316k i/s - 747.250k times in 6.109176s (8.18μs/i)
324
- push + pop (bsearch) 1.794M i/s - 9.663M times in 5.387620s (557.55ns/i)
325
- push + pop (rb_heap) 707.140k i/s - 4.225M times in 5.975062s (1.41μs/i)
326
- push + pop (c_dheap) 2.718M i/s - 15.377M times in 5.656979s (367.89ns/i)
375
+ push + pop (findmin) 120.450k i/s - 734.101k times in 6.094657s (8.30μs/i)
376
+ push + pop (bsearch) 1.799M i/s - 10.665M times in 5.928598s (555.87ns/i)
377
+ push + pop (rb_heap) 870.024k i/s - 5.513M times in 6.336058s (1.15μs/i)
378
+ push + pop (c++ stl) 5.594M i/s - 30.001M times in 5.363045s (178.76ns/i, 451clocks/i)
379
+ push + pop (c_dheap) 6.991M i/s - 39.117M times in 5.595561s (143.05ns/i, 373clocks/i)
327
380
 
328
381
  Comparison:
329
- push + pop (c_dheap): 2718225.1 i/s
330
- push + pop (bsearch): 1793546.4 i/s - 1.52x slower
331
- push + pop (rb_heap): 707139.9 i/s - 3.84x slower
332
- push + pop (findmin): 122316.0 i/s - 22.22x slower
382
+ push + pop (c_dheap): 6990729.5 i/s
383
+ push + pop (c++ stl): 5594102.7 i/s - 1.25x slower
384
+ push + pop (bsearch): 1798974.6 i/s - 3.89x slower
385
+ push + pop (rb_heap): 870023.6 i/s - 8.04x slower
386
+ push + pop (findmin): 120449.9 i/s - 58.04x slower
333
387
 
334
388
  ################################################################################
335
389
  # Benchmarks with N=21845 (t=10sec/benchmark)
@@ -337,54 +391,63 @@ push + pop (findmin): 122316.0 i/s - 22.22x slower
337
391
 
338
392
  == push N (N=21845) ============================================================
339
393
  Warming up --------------------------------------
340
- push N (bsearch) 35.384 i/s - 72.000 times in 2.034790s (28.26ms/i)
341
- push N (rb_heap) 172.946 i/s - 360.000 times in 2.081571s (5.78ms/i)
342
- push N (c_dheap) 364.900 i/s - 740.000 times in 2.027956s (2.74ms/i)
394
+ push N (bsearch) 29.500 i/s - 60.000 times in 2.033920s (33.90ms/i)
395
+ push N (rb_heap) 180.110 i/s - 378.000 times in 2.098720s (5.55ms/i)
396
+ push N (c++ stl) 341.267 i/s - 700.000 times in 2.051181s (2.93ms/i)
397
+ push N (c_dheap) 452.850 i/s - 920.000 times in 2.031579s (2.21ms/i)
343
398
  Calculating -------------------------------------
344
- push N (bsearch) 34.023 i/s - 212.000 times in 6.231133s (29.39ms/i)
345
- push N (rb_heap) 174.336 i/s - 1.037k times in 5.948268s (5.74ms/i)
346
- push N (c_dheap) 368.253 i/s - 2.189k times in 5.944276s (2.72ms/i)
399
+ push N (bsearch) 34.825 i/s - 176.000 times in 5.053771s (28.71ms/i)
400
+ push N (rb_heap) 178.444 i/s - 1.080k times in 6.052328s (5.60ms/i)
401
+ push N (c++ stl) 339.996 i/s - 2.047k times in 6.020652s (2.94ms/i)
402
+ push N (c_dheap) 471.606 i/s - 2.717k times in 5.761168s (2.12ms/i)
347
403
 
348
404
  Comparison:
349
- push N (c_dheap): 368.3 i/s
350
- push N (rb_heap): 174.3 i/s - 2.11x slower
351
- push N (bsearch): 34.0 i/s - 10.82x slower
405
+ push N (c_dheap): 471.6 i/s
406
+ push N (c++ stl): 340.0 i/s - 1.39x slower
407
+ push N (rb_heap): 178.4 i/s - 2.64x slower
408
+ push N (bsearch): 34.8 i/s - 13.54x slower
352
409
 
353
410
  == push N then pop N (N=21845) ================================================
354
411
  Warming up --------------------------------------
355
- push N + pop N (findmin) 0.779 i/s - 2.000 times in 2.566006s (1.28s/i)
356
- push N + pop N (bsearch) 34.145 i/s - 72.000 times in 2.108676s (29.29ms/i)
357
- push N + pop N (rb_heap) 24.870 i/s - 51.000 times in 2.050656s (40.21ms/i)
358
- push N + pop N (c_dheap) 102.725 i/s - 209.000 times in 2.034560s (9.73ms/i)
412
+ push N + pop N (findmin) 0.779 i/s - 2.000 times in 2.567523s (1.28s/i)
413
+ push N + pop N (bsearch) 34.097 i/s - 72.000 times in 2.111648s (29.33ms/i)
414
+ push N + pop N (rb_heap) 30.004 i/s - 63.000 times in 2.099747s (33.33ms/i)
415
+ push N + pop N (c++ stl) 162.161 i/s - 340.000 times in 2.096682s (6.17ms/i)
416
+ push N + pop N (c_dheap) 174.422 i/s - 360.000 times in 2.063954s (5.73ms/i)
359
417
  Calculating -------------------------------------
360
- push N + pop N (findmin) 0.777 i/s - 4.000 times in 5.148214s (1.29s/i)
361
- push N + pop N (bsearch) 33.931 i/s - 204.000 times in 6.012272s (29.47ms/i)
362
- push N + pop N (rb_heap) 25.005 i/s - 149.000 times in 5.958910s (39.99ms/i)
363
- push N + pop N (c_dheap) 101.482 i/s - 616.000 times in 6.070050s (9.85ms/i)
418
+ push N + pop N (findmin) 0.778 i/s - 4.000 times in 5.144549s (1.29s/i)
419
+ push N + pop N (bsearch) 32.991 i/s - 204.000 times in 6.183540s (30.31ms/i)
420
+ push N + pop N (rb_heap) 29.347 i/s - 180.000 times in 6.133559s (34.08ms/i)
421
+ push N + pop N (c++ stl) 164.692 i/s - 972.000 times in 5.901925s (6.07ms/i)
422
+ push N + pop N (c_dheap) 171.201 i/s - 1.046k times in 6.109760s (5.84ms/i)
364
423
 
365
424
  Comparison:
366
- push N + pop N (c_dheap): 101.5 i/s
367
- push N + pop N (bsearch): 33.9 i/s - 2.99x slower
368
- push N + pop N (rb_heap): 25.0 i/s - 4.06x slower
369
- push N + pop N (findmin): 0.8 i/s - 130.61x slower
425
+ push N + pop N (c_dheap): 171.2 i/s
426
+ push N + pop N (c++ stl): 164.7 i/s - 1.04x slower
427
+ push N + pop N (bsearch): 33.0 i/s - 5.19x slower
428
+ push N + pop N (rb_heap): 29.3 i/s - 5.83x slower
429
+ push N + pop N (findmin): 0.8 i/s - 220.19x slower
370
430
 
371
431
  == Push/pop with pre-filled queue (size=N) (N=21845) ==========================
372
432
  Warming up --------------------------------------
373
- push + pop (findmin) 13.737k i/s - 27.540k times in 2.004757s (72.79μs/i)
374
- push + pop (bsearch) 1.512M i/s - 3.037M times in 2.008949s (661.44ns/i)
375
- push + pop (rb_heap) 606.616k i/s - 1.239M times in 2.042544s (1.65μs/i)
376
- push + pop (c_dheap) 2.034M i/s - 4.134M times in 2.032566s (491.70ns/i)
433
+ push + pop (findmin) 9.674k i/s - 19.701k times in 2.036569s (103.37μs/i)
434
+ push + pop (bsearch) 1.565M i/s - 3.181M times in 2.032390s (638.93ns/i)
435
+ push + pop (rb_heap) 830.840k i/s - 1.701M times in 2.047922s (1.20μs/i)
436
+ push + pop (c++ stl) 4.606M i/s - 9.338M times in 2.027286s (217.11ns/i, 525clocks/i)
437
+ push + pop (c_dheap) 5.854M i/s - 11.791M times in 2.014052s (170.81ns/i, 453clocks/i)
377
438
  Calculating -------------------------------------
378
- push + pop (findmin) 15.583k i/s - 82.423k times in 5.289229s (64.17μs/i)
379
- push + pop (bsearch) 1.575M i/s - 9.071M times in 5.760389s (635.03ns/i)
380
- push + pop (rb_heap) 611.005k i/s - 3.640M times in 5.956897s (1.64μs/i)
381
- push + pop (c_dheap) 2.264M i/s - 12.203M times in 5.389179s (441.64ns/i)
439
+ push + pop (findmin) 11.522k i/s - 58.041k times in 5.037203s (86.79μs/i)
440
+ push + pop (bsearch) 1.528M i/s - 9.391M times in 6.144507s (654.32ns/i)
441
+ push + pop (rb_heap) 802.621k i/s - 4.985M times in 6.210948s (1.25μs/i)
442
+ push + pop (c++ stl) 4.959M i/s - 27.636M times in 5.573344s (201.67ns/i, 561clocks/i)
443
+ push + pop (c_dheap) 6.275M i/s - 35.126M times in 5.597394s (159.35ns/i, 421clocks/i)
382
444
 
383
445
  Comparison:
384
- push + pop (c_dheap): 2264291.2 i/s
385
- push + pop (bsearch): 1574732.8 i/s - 1.44x slower
386
- push + pop (rb_heap): 611005.2 i/s - 3.71x slower
387
- push + pop (findmin): 15583.2 i/s - 145.30x slower
446
+ push + pop (c_dheap): 6275438.5 i/s
447
+ push + pop (c++ stl): 4958577.7 i/s - 1.27x slower
448
+ push + pop (bsearch): 1528297.6 i/s - 4.11x slower
449
+ push + pop (rb_heap): 802621.5 i/s - 7.82x slower
450
+ push + pop (findmin): 11522.5 i/s - 544.63x slower
388
451
 
389
452
  ################################################################################
390
453
  # Benchmarks with N=87381 (t=10sec/benchmark)
@@ -392,52 +455,61 @@ push + pop (findmin): 15583.2 i/s - 145.30x slower
392
455
 
393
456
  == push N (N=87381) ============================================================
394
457
  Warming up --------------------------------------
395
- push N (bsearch) 2.973 i/s - 6.000 times in 2.017930s (336.32ms/i)
396
- push N (rb_heap) 43.444 i/s - 90.000 times in 2.071609s (23.02ms/i)
397
- push N (c_dheap) 93.043 i/s - 190.000 times in 2.042069s (10.75ms/i)
458
+ push N (bsearch) 2.860 i/s - 6.000 times in 2.097866s (349.64ms/i)
459
+ push N (rb_heap) 44.082 i/s - 90.000 times in 2.041662s (22.69ms/i)
460
+ push N (c++ stl) 87.951 i/s - 180.000 times in 2.046591s (11.37ms/i)
461
+ push N (c_dheap) 114.586 i/s - 240.000 times in 2.094502s (8.73ms/i)
398
462
  Calculating -------------------------------------
399
- push N (bsearch) 2.929 i/s - 17.000 times in 5.805017s (341.47ms/i)
400
- push N (rb_heap) 43.528 i/s - 260.000 times in 5.973114s (22.97ms/i)
401
- push N (c_dheap) 92.841 i/s - 558.000 times in 6.010303s (10.77ms/i)
463
+ push N (bsearch) 2.876 i/s - 17.000 times in 5.910605s (347.68ms/i)
464
+ push N (rb_heap) 44.019 i/s - 264.000 times in 5.997408s (22.72ms/i)
465
+ push N (c++ stl) 79.328 i/s - 527.000 times in 6.643283s (12.61ms/i)
466
+ push N (c_dheap) 115.006 i/s - 687.000 times in 5.973623s (8.70ms/i)
402
467
 
403
468
  Comparison:
404
- push N (c_dheap): 92.8 i/s
405
- push N (rb_heap): 43.5 i/s - 2.13x slower
406
- push N (bsearch): 2.9 i/s - 31.70x slower
469
+ push N (c_dheap): 115.0 i/s
470
+ push N (c++ stl): 79.3 i/s - 1.45x slower
471
+ push N (rb_heap): 44.0 i/s - 2.61x slower
472
+ push N (bsearch): 2.9 i/s - 39.99x slower
407
473
 
408
474
  == push N then pop N (N=87381) ================================================
409
475
  Warming up --------------------------------------
410
- push N + pop N (findmin)0.0 i/s - 0.0 times in 15.004208s (Infs/i)
411
- push N + pop N (bsearch) 2.904 i/s - 6.000 times in 2.066042s (344.34ms/i)
412
- push N + pop N (rb_heap) 5.506 i/s - 12.000 times in 2.179391s (181.62ms/i)
413
- push N + pop N (c_dheap) 22.529 i/s - 48.000 times in 2.130599s (44.39ms/i)
476
+ push N + pop N (findmin)0.0 i/s - 0.0 times in 15.004015s (Infs/i)
477
+ push N + pop N (bsearch) 2.818 i/s - 6.000 times in 2.129230s (354.87ms/i)
478
+ push N + pop N (rb_heap) 6.587 i/s - 14.000 times in 2.125416s (151.82ms/i)
479
+ push N + pop N (c++ stl) 38.095 i/s - 80.000 times in 2.100037s (26.25ms/i)
480
+ push N + pop N (c_dheap) 39.934 i/s - 80.000 times in 2.003287s (25.04ms/i)
414
481
  Calculating -------------------------------------
415
- push N + pop N (findmin)0.0 i/s - 0.0 times in 15.004208s (Infs/i)
416
- push N + pop N (bsearch) 2.861 i/s - 17.000 times in 5.942237s (349.54ms/i)
417
- push N + pop N (rb_heap) 5.540 i/s - 33.000 times in 5.956511s (180.50ms/i)
418
- push N + pop N (c_dheap) 22.614 i/s - 135.000 times in 5.969706s (44.22ms/i)
482
+ push N + pop N (findmin)0.0 i/s - 0.0 times in 15.004015s (Infs/i)
483
+ push N + pop N (bsearch) 2.905 i/s - 16.000 times in 5.507260s (344.20ms/i)
484
+ push N + pop N (rb_heap) 6.675 i/s - 39.000 times in 5.843054s (149.82ms/i)
485
+ push N + pop N (c++ stl) 38.576 i/s - 228.000 times in 5.910361s (25.92ms/i)
486
+ push N + pop N (c_dheap) 39.508 i/s - 239.000 times in 6.049426s (25.31ms/i)
419
487
 
420
488
  Comparison:
421
- push N + pop N (c_dheap): 22.6 i/s
422
- push N + pop N (rb_heap): 5.5 i/s - 4.08x slower
423
- push N + pop N (bsearch): 2.9 i/s - 7.90x slower
489
+ push N + pop N (c_dheap): 39.5 i/s
490
+ push N + pop N (c++ stl): 38.6 i/s - 1.02x slower
491
+ push N + pop N (rb_heap): 6.7 i/s - 5.92x slower
492
+ push N + pop N (bsearch): 2.9 i/s - 13.60x slower
424
493
  push N + pop N (findmin): 0.0 i/s - Infx slower
425
494
 
426
495
  == Push/pop with pre-filled queue (size=N) (N=87381) ==========================
427
496
  Warming up --------------------------------------
428
- push + pop (findmin) 2.275k i/s - 4.683k times in 2.058769s (439.63μs/i)
429
- push + pop (bsearch) 682.628k i/s - 1.372M times in 2.010489s (1.46μs/i)
430
- push + pop (rb_heap) 519.439k i/s - 1.058M times in 2.037582s (1.93μs/i)
431
- push + pop (c_dheap) 1.713M i/s - 3.455M times in 2.016970s (583.83ns/i)
497
+ push + pop (findmin) 1.301k i/s - 2.646k times in 2.033177s (768.40μs/i)
498
+ push + pop (bsearch) 399.722k i/s - 802.368k times in 2.007313s (2.50μs/i)
499
+ push + pop (rb_heap) 693.504k i/s - 1.416M times in 2.042452s (1.44μs/i)
500
+ push + pop (c++ stl) 3.984M i/s - 7.970M times in 2.000250s (250.98ns/i, 578clocks/i)
501
+ push + pop (c_dheap) 5.101M i/s - 10.348M times in 2.028583s (196.05ns/i, 321clocks/i)
432
502
  Calculating -------------------------------------
433
- push + pop (findmin) 2.263k i/s - 13.647k times in 6.031111s (441.94μs/i)
434
- push + pop (bsearch) 762.343k i/s - 4.096M times in 5.372602s (1.31μs/i)
435
- push + pop (rb_heap) 535.914k i/s - 3.117M times in 5.815555s (1.87μs/i)
436
- push + pop (c_dheap) 1.815M i/s - 10.277M times in 5.661404s (550.88ns/i)
503
+ push + pop (findmin) 1.305k i/s - 7.808k times in 5.983727s (766.36μs/i)
504
+ push + pop (bsearch) 516.666k i/s - 2.398M times in 4.641947s (1.94μs/i)
505
+ push + pop (rb_heap) 695.029k i/s - 4.161M times in 5.986830s (1.44μs/i)
506
+ push + pop (c++ stl) 4.478M i/s - 23.906M times in 5.338832s (223.32ns/i, 577clocks/i)
507
+ push + pop (c_dheap) 5.968M i/s - 30.605M times in 5.128099s (167.56ns/i, 426clocks/i)
437
508
 
438
509
  Comparison:
439
- push + pop (c_dheap): 1815277.3 i/s
440
- push + pop (bsearch): 762343.2 i/s - 2.38x slower
441
- push + pop (rb_heap): 535913.6 i/s - 3.39x slower
442
- push + pop (findmin): 2262.8 i/s - 802.24x slower
510
+ push + pop (c_dheap): 5968137.3 i/s
511
+ push + pop (c++ stl): 4477815.8 i/s - 1.33x slower
512
+ push + pop (rb_heap): 695029.1 i/s - 8.59x slower
513
+ push + pop (bsearch): 516665.5 i/s - 11.55x slower
514
+ push + pop (findmin): 1304.9 i/s - 4573.73x slower
443
515