RFR (S) 8146801: Allocating short arrays of non-constant size is slow
christian.thalinger at oracle.com
Mon Feb 29 21:53:41 UTC 2016
> On Feb 29, 2016, at 11:02 AM, Aleksey Shipilev <aleksey.shipilev at oracle.com> wrote:
> 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;
+ product_pd(intx, InitArrayShortSize, \
Don’t make it a product flag; diagnostic should be sufficient. This will require adding diagnostic_pd support. If you don’t want to do that make the flag develop.
> 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 --------------
An HTML attachment was scrubbed...
More information about the hotspot-compiler-dev