Cache page source physical file parent for performance

Description

Working on the Techempower benchmarks again tonight and doing load testing of the plain test test on Lucee 5.3.8 and I'm seeing a lot of threads with stack traces all looking like this:

java.lang.Thread.State: RUNNABLE at java.lang.StringLatin1.newString(java.base@13.0.1/StringLatin1.java:767) at java.lang.String.substring(java.base@13.0.1/String.java:1914) at java.io.File.getParent(java.base@13.0.1/File.java:479) at lucee.runtime.listener.MixedAppListener.getApplicationPageSource(MixedAppListener.java:68) at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:42) at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2460) at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2450) at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2421) at lucee.runtime.engine.Request.exe(Request.java:45) at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1179)

In one test running 100 threads, 50 of them were captured in a thread dump performing the above code.

The line of code running is here:

requestedPage.getPhyscalFile().getParent()

The requestedPage variable is an instance of PageSource. Assuming these actual page source instances are cached, let's cache the result of ".getPhyscalFile().getParent()" inside of them to optimize this lookup which is happening on every request.

Attachments

1
  • 18 Jul 2024, 03:38 pm

relates to

Activity

Show:

Michael Offner 18 July 2024 at 15:38

this is the search for the Application.cfc when mode is set “current to root“

 

Screenshot 2024-07-18 at 17.32.47.png

this got cached in meantime

Fixed

Details

Assignee

Reporter

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

Sprint

Priority

Created 10 February 2022 at 07:10
Updated 18 July 2024 at 15:38
Resolved 18 July 2024 at 15:38

Flag notifications