George
03/04/2025, 4:30 PMGeorge
03/04/2025, 4:31 PMFilipp Zhinkin
03/04/2025, 7:02 PMdataSet
list is always empty, because buildList { for (number in 1..size) { .. }
uses list builder's size, not the benchmark parameter.
The teardown method is called after each iteration, but the setup one is called only once per benchmark execution. As a result, the size parameter won't affect results anyway, as the list will be empty after the first iteration.
Also, I'd suggest increasing the number of warmup iterations and using a more up-to-date version of JMH (1.37).George
03/04/2025, 7:28 PMGeorge
03/05/2025, 8:29 AMk
and not n
. 🤔Huib Donkers
03/05/2025, 12:30 PMThe teardown method is called after each iteration, but the setup one is called only once per benchmark execution. As a result, the size parameter won't affect results anyway, as the list will be empty after the first iteration.Try instead
@Setup(Level.Iteration)
George
03/05/2025, 12:40 PM