diff --git a/test/Benchmarks/src/Numeric.enso b/test/Benchmarks/src/Numeric.enso index a39e77996a63..f8be613eacf1 100644 --- a/test/Benchmarks/src/Numeric.enso +++ b/test/Benchmarks/src/Numeric.enso @@ -1,6 +1,8 @@ from Standard.Base import all +import Standard.Base.Runtime.Ref.Ref from Standard.Test import Bench, Faker +from Standard.Base.Runtime import assert options = Bench.options . set_warmup (Bench.phase_conf 1 3) . set_measure (Bench.phase_conf 1 3) @@ -47,6 +49,16 @@ collect_benches = Bench.build builder-> group_builder.specify ("float_" + name) (data.floats.map fun) group_builder.specify ("integer_" + name) (data.integers.map fun) + up_to_options = Bench.options . set_warmup (Bench.phase_conf 5 2) . set_measure (Bench.phase_conf 3 2) + + builder.group "Numeric_Up_To" up_to_options group_builder-> + group_builder.specify "counting_up_to_1000000" <| + cell = Ref.new 0 + n = 100000000 + 0.up_to n . each _-> + x = cell.get + cell.put x+1 + assert cell.get==n "Expecting "+n.to_text+" but was "+cell.get.to_text ## Creates a valid name for the benchmark create_name : Text -> Integer -> Boolean -> Text