Variability of the performance of Vector<E>

Daniel Lemire daniel at lemire.me
Thu Jan 8 09:23:46 UTC 2026


Let me make my comment clearer. Here are the operations that one can expect to be affected: a character search, a copy, a byte-by-byte comparison… on non-trivial inputs that reside in fast cache. Basically cases where the compute part is basically negligible and we are driven by load/store operations.

These are cheap operations that will be very fast and might be a tad slower on some hardware when the alignment is off.

These operations are “common” but they are also often supported by intrinsic functions.




> On 7 Jan 2026, at 16:28, Daniel Lemire wrote:
> 
> > The 25% is real but it affects mostly simple functions that do little compute. Like a memory copy, or a quick scan of an input.
> >
> > Daniel Lemire, "Dot product on misaligned data," in *Daniel Lemire's blog*, July 14, 2025, https://urldefense.com/v3/__https://lemire.me/blog/2025/07/14/dot-product-on-misaligned-data/__;!!ACWV5N9M2RV99hQ!K9TplKFS-WUOa0MaUq2AHthEGN65CdQg4SMS7SPHfeftYwG4A2S_2jP9hWf_6B2iBjb6V-MeGAQCO-hOcQ$ .
> >
> 
> Good point.  We expect such affected functions to be common, right?
> 
> Surely vectorized hashcode or comparison is affected about as much
> as dot product.
> 
> Also, we are in the habit of worrying about micro-benchmarks, which
> are usually oversimplified, but may well show the 25% effect.
> This is a sad habit for us platform folks, but a necessary one.
> 
> Finally, Peter’s very interesting "trip report" showed another
> common story:  The 25% showed up only after he removed some
> performance bugs (accumulator bottlenecks).  It sure would be
> nice to reward the diligent coder with the full benefit,
> rather than take away the last 25% due to misalignment.
> 
> What I think (or hope) is that a large array hyper-alignment
> feature could silently patch up a number of such artifacts.
> 
> — John
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20260108/dd6ae98b/attachment-0001.htm>


More information about the panama-dev mailing list