Variability of the performance of Vector<E>
John Rose
john.r.rose at oracle.com
Thu Jan 8 00:42:34 UTC 2026
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
More information about the panama-dev
mailing list