Seam 2
  1. Seam 2
  2. JBSEAM-1977

Add reflection bytecode optimization in JBoss EL

    Details

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

      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.

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

        Activity

        Hide
        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
        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
        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
        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
        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
        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
        added a comment -

        I like the idea

        Show
        Norman Richards
        added a comment - I like the idea
        Hide
        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
        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
        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
        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
        Pete Muir
        added a comment -

        I have no real idea how this can implemented sanely.

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

          People

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

            Dates

            • Created:
              Updated:
              Resolved: