You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While analyzing the performance of some Kotlin stdlib functions, I faced the following issue: when running wasmJs benchmarks, the first benchmark among the batch always runs faster.
Consider the following example:
@Benchmark fun a(blackhole: Blackhole) { blackhole.consume(1) }
@Benchmark fun b(blackhole: Blackhole) { blackhole.consume(2) }
@Benchmark fun c(blackhole: Blackhole) { blackhole.consume(3) }
All three functions are identical (module the numeric literal), but when benchmarked, a is always faster:
I tried to analyze V8 logs (I have no expertise in that area), but didn't find anything that could explain performance degradation after the first benchmark execution finished.
fzhinkin
added a commit
to fzhinkin/kt-64361-benchmarks
that referenced
this issue
Apr 2, 2024
While analyzing the performance of some Kotlin stdlib functions, I faced the following issue: when running wasmJs benchmarks, the first benchmark among the batch always runs faster.
Consider the following example:
All three functions are identical (module the numeric literal), but when benchmarked,
a
is always faster:If the first function is excluded and now the run consists of only two benchmarks, the one executed earlier will be faster again:
The issue is not reproducible with js target.
You can find a demo project here: https://github.com/fzhinkin/kotlinx-benchmark-wasmjs-issue
The text was updated successfully, but these errors were encountered: