RFR (S) 8146801: Allocating short arrays of non-constant size is slow
aleksey.shipilev at oracle.com
Mon Feb 29 21:02:47 UTC 2016
Object storage zeroing uses "rep stos" instructions on x86, which are
fast on long lengths, but have the setup penalty. We successfully avoid
that penalty when zeroing the objects of known lengths (all objects and
arrays of constant sizes). However, we don't do anything for arrays of
non-constant sizes, which are very frequent.
See more details here:
The core of the changes is at MacroAssembler::clear_mem.
The rest is collateral:
a) pulling InitArrayShortSize from Matchers to global VM options to
get the access to it in MacroAssembler;
b) dragging ClearArrayNode::_is_large when ClearArrayNode::Ideal bails
on large constant length -- otherwise we produce effectively dead code
for short loop in MacroAssembler, that is never taken.
With this patch, the allocation performance for small arrays is improved
3-4x. Performance data and disassemblies:
Testing: JPRT -testset hotspot; targeted microbenchmarks; RBT
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: OpenPGP digital signature
More information about the hotspot-compiler-dev