diff --git a/caffeine/microbenchmarks/bench_utils.py b/caffeine/microbenchmarks/bench_utils.py index 4166838..b949749 100644 --- a/caffeine/microbenchmarks/bench_utils.py +++ b/caffeine/microbenchmarks/bench_utils.py @@ -58,6 +58,14 @@ def cache_in_redis(num): bench_flt_typical = NanoBenchmark( + """flt(x, 2)""", + setup="x = random.uniform(1, 10000)", + globals={"flt": flt, "random": random}, +) + +# Rarely this is specified in code. +# But certain hot loops can benefit from this. +bench_flt_explicit_rounding = NanoBenchmark( """flt(x, 2, rounding_method="Banker's Rounding")""", setup="x = random.uniform(1, 10000)", globals={"flt": flt, "random": random},