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

Major performance regression in reflection APIs in some common use-cases

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.0
    • 1.4.0
    • hotspot
    • beta
    • x86
    • windows_nt

      The enclosed sample program (using the latest copy of the
      classes in java.beans.* in both cases) takes 7s on the VM of
      1.3 and 112s on the latest promoted build of 1.4 (57). [This
      was tested on a dual ~300MHz pentium running NT). It seems
      that the new optimisations to the reflection package improve the
      speed of reflective calls in tight loops at the expense of code
      that invokes a large number of methods a small number of times.

      There are many applications in client-side java which use
      the reflection package in the latter mode. In the beans
      package, two good examples are: the java.beans.Introspector which
      is used by builders to interrogate visual "JavaBeans" and
      the java.beans.Expression class which facilitates use of an
      interpretive method invocation (c.f. the "perform" method of SmallTalk
      or Objective-C). The Statement and Expression classes are used to
      read and write "version resilient" archives of object graphs.

      The upper bound on the number of times a method will be invoked
      in the Expression class is 1, meaning that perfomance is
      much more sensitive to the time taken to search for methods
      with a given signature than it is to the time taken to
      do the reflective invocation of a method.

            kbr Kenneth Russell (Inactive)
            pmilnesunw Philip Milne (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: