Skip to content

Conversation

hpcdisrespecter
Copy link

Otherwise, warning is emitted by test harness:

 benchmark was likely optimized out (dead code elimination) = !
 https://github.com/evanwashere/mitata#writing-good-benchmarks

@tpetry
Copy link

tpetry commented Apr 24, 2025

The mitata docs show that a value should be passed into the do_not_optimize function. Not a closure. Are you sure that closure is really executed by mitata?

@hpcdisrespecter
Copy link
Author

I'm not sure.
What I am sure of is that, by default, when running small tests, that bun doesn't actually run the code. It reports sub-100ps speeds, which mitata flags as erroneous, probably because bun is optimizing this out, so the benchmark is incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants