Skip to content

Performance issues from repeating ImportHandler.resolveClass calls for null attributes #245

@aogburn

Description

@aogburn

This is an issue like https://bz.apache.org/bugzilla/show_bug.cgi?id=57583 that I currently reproduce on EAP 7.4 (using pages 2.3.x) and EAP 8.0 (using pages 3.1.x). An easy stress test is a jsp referring to many null attributes:
<td><p style="color: red">${error1}</p></td> \<td><p style="color: red">${error2}</p></td> ... \<td><p style="color: red">${error999}</p></td> \<td><p style="color: red">${error1000}</p></td>

This performs much worse (10-20x longer) on EAP 7/8 where the ImportHandler is now used compared to EAP 6 that did not . Requests spend all their time in Class.forName calls from the ImportHandler:
"default task-10" #157 prio=5 os_prio=0 cpu=2098.07ms elapsed=21.51s tid=0x0000562376ddf800 nid=0x37ded runnable [0x00007f15ab838000] java.lang.Thread.State: RUNNABLE at java.lang.Class.forName0(java.base@11.0.20/Native Method) at java.lang.Class.forName(java.base@11.0.20/Class.java:398) at jakarta.el.ImportHandler.getClassFor(ImportHandler.java:169) at jakarta.el.ImportHandler.resolveClassFor(ImportHandler.java:145) at jakarta.el.ImportHandler.resolveClass(ImportHandler.java:109) at jakarta.servlet.jsp.el.ImportELResolver.getValue(ImportELResolver.java:62) at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:123) at org.glassfish.expressly.parser.AstIdentifier.getValue(AstIdentifier.java:97) at org.glassfish.expressly.ValueExpressionImpl.getValue(ValueExpressionImpl.java:138) at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:925) at org.apache.jsp.test_jsp._jspService(test_jsp.java:1077)
So could some form of caching be considered here for a performance improvement?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions