Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-1977

Add reflection bytecode optimization in JBoss EL

    Details

    • Type: Feature Request
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Rejected
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: EL
    • Labels:
      None

      Description

      Add reflection bytecode optimization in JBoss EL.

      It could be done optional (as in Hibernate)

      Even on JDK 5 cglib FastClass performs reflection calls faster.

      EL is used heavily during render phase and it is critical that it is optimized for performance.

        Gliffy Diagrams

        1. ReflectionTest.java
          4 kB
          Mikhail Grushinskiy
        2. ReflectionTest.java
          3 kB
          Mikhail Grushinskiy
        3. ReflectionTest.java
          2 kB
          Mikhail Grushinskiy

          Activity

          Hide
          mgrouch Mikhail Grushinskiy added a comment -

          Attached program illustrates performance gains by using cglib for doing reflection calls

          Output

          Run1 time=11218ms
          Run2 time=766ms
          Run3 time=109ms

          It is more than 7 times faster

          (JDK 1.5, Windows, cglib 2.1.3)

          Show
          mgrouch Mikhail Grushinskiy added a comment - Attached program illustrates performance gains by using cglib for doing reflection calls Output Run1 time=11218ms Run2 time=766ms Run3 time=109ms It is more than 7 times faster (JDK 1.5, Windows, cglib 2.1.3)
          Hide
          mgrouch Mikhail Grushinskiy added a comment -

          Using method index it is even faster. (Close to 10 times)

          Run1 time=11063ms
          Run2 time=719ms
          Run3 time=93ms
          Run4 time=78ms

          See getBeanPropertyViaCglibMethodIndex

          in attachment.

          Show
          mgrouch Mikhail Grushinskiy added a comment - Using method index it is even faster. (Close to 10 times) Run1 time=11063ms Run2 time=719ms Run3 time=93ms Run4 time=78ms See getBeanPropertyViaCglibMethodIndex in attachment.
          Hide
          mgrouch Mikhail Grushinskiy added a comment -

          Don't use javassist though. It performs even worse than JDK's reflection

          Run1 time=11188ms
          Run2 time=672ms
          Run3 time=93ms
          Run4 time=94ms
          Run5 time=17547ms (Run5 is javassist)

          Show
          mgrouch Mikhail Grushinskiy added a comment - Don't use javassist though. It performs even worse than JDK's reflection Run1 time=11188ms Run2 time=672ms Run3 time=93ms Run4 time=94ms Run5 time=17547ms (Run5 is javassist)
          Hide
          norman.richards Norman Richards added a comment -

          I like the idea

          Show
          norman.richards Norman Richards added a comment - I like the idea
          Hide
          nickarls Nicklas Karlsson added a comment -

          Just out of curiosity: considering that the hibernate people are very familiar with cglib, what was the design issue of not using it in seam in the first place?

          Show
          nickarls Nicklas Karlsson added a comment - Just out of curiosity: considering that the hibernate people are very familiar with cglib, what was the design issue of not using it in seam in the first place?
          Hide
          pmuir Pete Muir added a comment -

          It was used in earlier versions of Seam. But, as with Hibernate, it was dropped in favour of javassist.

          Show
          pmuir Pete Muir added a comment - It was used in earlier versions of Seam. But, as with Hibernate, it was dropped in favour of javassist.
          Hide
          pmuir Pete Muir added a comment -

          I have no real idea how this can implemented sanely.

          Show
          pmuir Pete Muir added a comment - I have no real idea how this can implemented sanely.

            People

            • Assignee:
              pmuir Pete Muir
              Reporter:
              mgrouch Mikhail Grushinskiy
            • Votes:
              24 Vote for this issue
              Watchers:
              15 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development