Unresolved
Details
Details
Assignee
Pothys - MitrahSoft
Pothys - MitrahSoftReporter
Tim Parker
Tim ParkerPriority
Labels
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Affects versions
Created 28 October 2015 at 15:56
Updated 2 November 2021 at 08:03
(originally reported as Railo-3282 - https://issues.jboss.org/browse/RAILO-3282)
Our code makes extensive use of Java objects - some of which are relatively complex and large. In one case, we discovered that when we passed one of these objects to a Java method, Railo was taking several seconds to do a deep inspection of an object with about 1000 nodes - [about 2ms per node] - Railo appears to be looking for ObjectWrap objects - see .../runtime/reflection/Reflector.java - cleanArgs() and various _clean() methods
The method in question may be called multiple times in the course of a request, leading to completely unacceptable performance (8-10 seconds for an average page view... where 200ms or less is expected)
In this particular instance, our object implements Map - and our preliminary work-around is to create a simple wrapper object of our own which cleanArgs() doesn't know how to inspect - this work-around appears to be OK in preliminary testing, but (at a minimum) some further information about ObjectWrap objects is needed (when does Railo need to wrap objects??) so we can be sure this doesn't bite us later
Also... it appears (from review of Reflector.java) that some of the _clean() methods may result in objects (effectively) being passed by value instead of by reference if an ObjectWrap member is found
==============
to reproduce the problem... compile the attached 'CallTimer.java' and make it available to your instance (change the package as needed). Then run this code (changing the CreateObject call as needed for your environment):
{{itemCount = 100000;
timer = CreateObject("java","com.paperthin.common.test.CallTimer");
foo = CreateObject("java","java.util.TreeMap").init();
for (i = 0; i LT itemCount; i = 1 + i)
foo["node#i#"] = i;
WriteOutput("overhead for #itemCount# items: #timer.getCallOverhead(getTickCount(),foo)#ms<br />");}}