-
New Feature
-
Resolution: Done
-
Major
-
8.6.0.1
-
Security Level: Jimmy
-
ZK 8.6.1 S1
-
None
Steps to Reproduce
repeated calls to resove EL variable suffer from a performance hit due to uncached unresolvable classes
<div> <custom-attributes myvar="123"/> <div forEach="1,2,3"> ${myvar} </div> </div>
The code above leads to 3 caught ClassNotFoundExceptions in org.zkoss.zel.ImportHandler#findClass(String name)
https://github.com/zkoss/zk/blob/v8.6.0.1/zel/src/org/zkoss/zel/ImportHandler.java#L203-L207
The attached test scenario TestImportHandlerPerformance.java highlighting the difference between a cache hit and a cache miss at larger volumes.
At 100000 repetitions, resolving java.lang.Object takes ~<1ms, while repeated failing to resolve a variable 'test' results in significant slowdown (~600ms)
Possible Solution
This has been avoided in tomcat's EL implementation since 8.0.21
https://tomcat.apache.org/tomcat-8.0-doc/changelog.html#Tomcat_8.0.21_(markt)/Jasper
https://bz.apache.org/bugzilla/show_bug.cgi?id=57583
We should further evaluate if a later tomcat version (8.5 or 9 - all use EL 3.0 ) contains additional beneficial fixes and improvements to merge in to ZK's EL adaptation.
- relates to
-
ZK-4468 ImportHandler fails to import correct class after cached "NotFound"
- Closed