Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.4
-
None
Description
Method EqualsBuilder.append(Object,Object) is 327 bc long, while current JIT hot methods inlining threshold (-XX:FreqInlineSize) = 325. Because of this, .append(Object,Object) is not inlined: with -XX:+PrintInlining -XX:+PrintCompilation following messages could be seen
.... @ 13 o.a.c.l.b.EqualsBuilder::append (327 bytes) hot method too big ....
Fail of inlining, by itself, is not so bad – just a bit penalty to performance. But crucial thing here: without all method being inlined Escape Analysis also fails to trace Builder instance lifespan, and fails to prove it NoEscape. This, in turn, leads EqualsBuilder to be really allocated on heap.
The funny thing here is: with .append(O,O) being just 2-3 bytecodes smaller, most of EqualsBuilder usage scenarios will be scalarized