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

improve performance of Object.getClass()

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 1.4.0
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      beta2
    • CPU:
      generic
    • OS:
      generic

      Description

      Object.getClass() is an operation that "feels" like it should be lightweight
      and efficient but isn't, since it's implemented by native code. Under
      hotspot, its performance lags behind other methods (e.g., Object.hashCode())
      which are treated specially by the compiler. Improving the performance of
      Object.getClass(), perhaps by inlining it, would have a significant positive
      impact on serialization performance in particular.

      Attached is a microbenchmark comparing the performance of Object.getClass() vs.
      Object.hashCode().

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jrose John Rose
              Reporter:
              mwarressunw Michael Warres (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: