What could cause large latency creating Lucee components on request start?

79 views Asked by At

We're switching from Railo to Lucee 5.2.3 and noticed that there is sometimes a large latency on request startup. I think I've boiled it down to a function that is loading about 30 components with createObject('component', ...) into the Request scope. On Railo, this list will load within a second. On Lucee it can take about 20 seconds, but not always. It seems to consistently occur if we need to dynamically create a datasource or connect to a datasource other than the primary global datasource for the environment. After the initial load of these component objects, it will load within a second. I can't figure out what could be causing this initial performance hit. The .cfc files are in subdirectories under the ROOT directory of the site, so I'm just using the standard <cfset Request.Helpers[ThisHelper] = createObject("component","cfcs.componentFileName") />. This function isn't calling the init(), it is just creating the objects. Also, this function is not where we dynamically create any datasources, it's exclusively creating objects in the request scope.

1

There are 1 answers

1
John Mawer On BEST ANSWER

Can't comment on Lucee specifically, but know that traditionally we've always avoided excessive object creation in CF. Could any of the objects get moved to application scope, created once and re-eused by all visitors?

Might also be something todo with Lucee being OSGi based rather than Classloader based. Perhaps some overhead on OSGi service startup?