Skip to content

a warning for sub-ns timings #130

@tpapp

Description

@tpapp

Results like

julia> using BenchmarkTools

julia> foo(x) = exp(x)
foo (generic function with 1 method)

julia> @btime foo(1)
  0.029 ns (0 allocations: 0 bytes)
2.718281828459045

confuse many discussions on the discourse forum and have limited real-world applicability.

Perhaps for timings below some threshold (eg 1ns, or something calculated from the CPU frequency, as much as that is meaningful) a warning could be printed indicating that the result is not necessarily meaningful in a nontrivial context.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions