3 ms·
Reusing the map between benchmark call spoils the benchmark. The first run needs to allocate data structures that might remain after a call to clear(). Allocate
by quantified 2y ago
Reusing the map between benchmark call spoils the benchmark. The first run needs to allocate data structures that might remain after a call to clear(). Allocate a fresh one for each run.
And use JMH, run some iterations. You might be surprised at the variability.
- tombert 2y agoGood to know! I will update the test and post updated results.