
The JVM's mysterious AllocatePrefetch options: what do they do? - sadiq
https://www.opsian.com/blog/jvms-allocateprefetch-options/
======
hinkley
The punchline:

30% allocation speedup for small-ish objects by prefetching memory locations
for the _next_ thread-local allocation while performing the current
allocation.

Even in the large object case, where average allocation time is not
substantially affected, the variability of those times is reduced
substantially.

------
cbsmith
Can we stop describing documented features as "mysterious"?

------
CountHackulus
I don't know if I've ever seen a java application where performance is so
maxed out that this was needed. Not to say that they don't exist, just that it
seems like an unnecessarily complex knob to turn.

~~~
jdmichal
Any Java code that is that tight would probably be looking at eliminating
allocations, not making them faster. Allocations mean new memory addresses,
new cache lines. If you reuse the same objects for the next operation, they're
already allocated and maybe even still in cache. And since Java touches all
the memory on object creation anyway, resetting the object isn't too
burdensome.

