From 9fa30feb8205956d0977410eb1156bd2d4371fb4 Mon Sep 17 00:00:00 2001 From: Rick Hull Date: Thu, 20 Jun 2024 17:40:38 -0400 Subject: [PATCH] update benchmarks --- test/bench/complete_tree.rb | 4 ++-- test/bench/heap.rb | 15 --------------- 2 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 test/bench/heap.rb diff --git a/test/bench/complete_tree.rb b/test/bench/complete_tree.rb index c54eefb..1eba5a6 100644 --- a/test/bench/complete_tree.rb +++ b/test/bench/complete_tree.rb @@ -20,7 +20,7 @@ EOF ns.each { |n| - h = CompleteBinaryTree.new + h = CompleteTree.new n.times { h.push rand } _val, secs = Timer.loop_avg { h.push rand @@ -45,7 +45,7 @@ EOF ns.each { |n| - h = CompleteBinaryTree.new + h = CompleteTree.new _val, secs = Timer.loop_avg { n.times { h.push rand } } diff --git a/test/bench/heap.rb b/test/bench/heap.rb deleted file mode 100644 index 6688bce..0000000 --- a/test/bench/heap.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'compsci/heap' -require 'minitest/autorun' -require 'minitest/benchmark' - -include CompSci - -describe "Heap#push Benchmark" do - before do - @heap = Heap.new - end - - bench_performance_constant "Heap#push (constant, 0.9999)", 0.9999 do |n| - n.times { @heap.push rand 99999 } - end -end