With the use of compare, if identical functions are supplied, the second will reproducibly benchmark ~10-30% faster than the first, regardless of what the functions are.
SSCCE:
module Test exposing (main)
import Benchmark exposing (Benchmark)
import Benchmark.Runner exposing (BenchmarkProgram, program)
main : BenchmarkProgram
main =
program suite
suite : Benchmark
suite =
Benchmark.compare "First vs. Second" "First" (\_ -> myFunction "zxcvbn") "Second" (\_ -> myFunction "zxcvbn")
myFunction : String -> String
myFunction =
String.reverse
and some results for various functions in myFunction:



This behavior extends to more complex functions as well, just presenting simple ones here so as to eliminate variables.
With the use of
compare, if identical functions are supplied, the second will reproducibly benchmark ~10-30% faster than the first, regardless of what the functions are.SSCCE:
and some results for various functions in



myFunction:This behavior extends to more complex functions as well, just presenting simple ones here so as to eliminate variables.