Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8266015

Implement AdapterHandlerLibrary lookup fast-path for common adapters

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 17
    • Fix Version/s: 17
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b22

      Description

      AdapterHandlerLibrary::get_adapter sees more activity during startup since 17-b13 (JDK-8265523). While re-implementing a cache mechanism to avoid lookups for methods loaded from CDS would address that regression more completely, I noticed that we spend a lot of time grabbing mutexes and parsing signatures of methods that are both trivial and very common.

      Refactoring the AdapterHandlerLibrary so that those common handlers can be created earlier in an earlier single-threaded bootstrap phase allows us to move some fast-path checks outside of the AdapterHandlerLibrary_lock. Avoiding spinning up a SignatureStream for these trivial methods also helps.

      By special-casing only a handful of such trivial and common adapters we get a 60% reduction in the number of lock operations and SignatureStream operations done in AdapterHandlerLibrary::get_adapter on HelloWorld. A reduction by ~2.4M instructions, which brings us almost back to the number of instructions we saw before 17-b13.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              redestad Claes Redestad
              Reporter:
              redestad Claes Redestad
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: