Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1218

EqualsBuilder.append(Object,Object) is too big to be inlined, which prevents whole builder to be scalarized

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.4
    • Fix Version/s: 3.5
    • Component/s: lang.builder.*
    • Labels:
      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

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              cheremin Ruslan Cheremin

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment