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

Optimize Symbol handling in ClassVerifier and SignatureStream

XMLWordPrintable

    • b13

      In ClassVerifier and SignatureStream, we currently do a lot of Symbol lookups. These Symbols are then kept alive incrementing refcount when necessary, adding them to a GrowableArray and decrementing refcount in each respective destructor.

      A few optimization have been identified which improve things in general:

      - do not add permanent symbols to the keepalive list -- this is helped along by ensuring all permanent symbols actually return true when calling is_permanent (add Symbol::make_permanent)
      - maintain a one-element lookup cache to avoid a fraction of all lookups (experimental data shows that repeated Symbols in signatures are quite common, and the number of avoided lookups for a single class can reach thousands)
      - narrow down the initial sizes of the GrowableArrays since we'll only add a fraction of the number of Symbols to them

            redestad Claes Redestad
            redestad Claes Redestad
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: