3 ms·
I echo the earlier comments to use jmh for benchmarking. There's lots of subtle issues that jmh solves. One thing I notice is that your sieve run doesn't retu
by MattPalmer1086 5y ago
I echo the earlier comments to use jmh for benchmarking. There's lots of subtle issues that jmh solves.
One thing I notice is that your sieve run doesn't return any values. Java can optimise out code that produces no effect in some circumstances.
EDIT: Although in that case, you'd expect to see it run insanely fast. Anyway, the point stands, there's lots of non obvious issues in benchmarking.