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

improve performance of Object.getClass()

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.4.0
    • hotspot
    • beta2
    • generic
    • generic

      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().

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: