@@ -120,7 +120,7 @@ defmodule ChorexBenchmarks do
120120 :ok
121121 end
122122
123- def nested_loop_stats do
123+ def nested_loop_stats ( do_heavy? \\ false ) do
124124 Logger . configure ( level: :alert ) # suppress crash messages
125125 [
126126 Benchee . run (
@@ -145,26 +145,28 @@ defmodule ChorexBenchmarks do
145145 memory_time: @ memory_time
146146 ) ,
147147
148- Benchee . run (
149- % {
150- "loop: with try, 10000 iterations, split work" => fn -> LoopBenches . runner ( 10000 , true , true ) end ,
151- "loop: with try, 10000 iterations, no split work" => fn -> LoopBenches . runner ( 10000 , true , false ) end ,
152- "loop: no try, 10000 iterations, split work" => fn -> LoopBenches . runner ( 10000 , false , true ) end ,
153- "loop: no try, 10000 iterations, no split work" => fn -> LoopBenches . runner ( 10000 , false , false ) end ,
154- } ,
155- time: @ time ,
156- memory_time: @ memory_time
157- ) ,
148+ ( if do_heavy? do
149+ Benchee . run (
150+ % {
151+ "loop: with try, 10000 iterations, split work" => fn -> LoopBenches . runner ( 10000 , true , true ) end ,
152+ "loop: with try, 10000 iterations, no split work" => fn -> LoopBenches . runner ( 10000 , true , false ) end ,
153+ "loop: no try, 10000 iterations, split work" => fn -> LoopBenches . runner ( 10000 , false , true ) end ,
154+ "loop: no try, 10000 iterations, no split work" => fn -> LoopBenches . runner ( 10000 , false , false ) end ,
155+ } ,
156+ time: @ time ,
157+ memory_time: @ memory_time
158+ )
159+ end )
158160 ]
159161 Logger . configure ( level: :warning ) # restore
160162 :ok
161163 end
162164
163- def stats do
165+ def stats ( do_heavy? \\ false ) do
164166 [
165167 miniblock_stats ( ) ,
166168 flat_loop_stats ( ) ,
167- nested_loop_stats ( ) ,
169+ nested_loop_stats ( do_heavy? ) ,
168170 sm_stats ( ) ,
169171 # big_chor_stats()
170172 ]
0 commit comments