Correct way to benchmark StaticVectors

Benchmarking looks fine to me. Generally, timings <1ns are suspicious and indicate a complete constant-folding of your function. But here you are using StaticArrays.jl with vectors of size 3 so each function are just a handful of FLOPS and modern CPUs are quite fast :slight_smile:

However this

is nonsense because it will always evaluate to false as just being discussed in another thread.
You’ll need to think about an absolute scale, e.g. given by the largest element of A and then set abstol accordingly. Though I am not sure what “accordingly” should mean concretely when considering det. @stevengj probably has an idea what an appropriate scale should be. I would propose abstol=sqrt(eps(eltype(A)))*maximum(A)

1 Like