Bug 56787

Summary: Simplified jndi name parsing
Product: Tomcat 8 Reporter: Sheldon Shao <xshao>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED WONTFIX    
Severity: enhancement    
Priority: P2    
Version: 8.5.x-trunk   
Target Milestone: ----   
Hardware: All   
OS: All   
Attachments: Patch
Screenshot got from JProfiler where tomcat is starting

Description Sheldon Shao 2014-07-29 09:48:09 UTC
Created attachment 31855 [details]
Patch

Tomcat uses JNDI to look up resource. The name of a resource needs to be parsed into a Name object. By default it is a CompositeName. 
Parsing a string to a CompositeName is low performance due to the following reason,

1. Call too many times of the method "String.startsWith"
2. Create StringBuffer instance for each component

The patch provides a simplified Name implementation. The parsing is around 6 times faster than the default one. The result was get on my Macbook Pro by running TestSimpleName.testAB().

The issue is impacting the start up of tomcat server. Because there are many resource looking up when server is starting.

The patch can improve the server start time.
Comment 1 Sheldon Shao 2014-07-29 09:49:53 UTC
Created attachment 31856 [details]
Screenshot got from JProfiler where tomcat is starting
Comment 2 Mark Thomas 2014-08-05 11:33:31 UTC
Marking this as an enhancement.

The profiler results appear to show that this is a fairly small part of the overall start time. I do have some concerns about the size of the patch compared to the expected benefit.

Could you provide some insight into: size of the application; start time without this patch; and start time with this patch?
Comment 3 hzhang9 2014-09-16 02:16:46 UTC
One of our application contains around 1800 jar files, and the benefit from the patch in this application is 300 ms faster on server startup.

(In reply to Mark Thomas from comment #2)
> Marking this as an enhancement.
> 
> The profiler results appear to show that this is a fairly small part of the
> overall start time. I do have some concerns about the size of the patch
> compared to the expected benefit.
> 
> Could you provide some insight into: size of the application; start time
> without this patch; and start time with this patch?
Comment 4 Mark Thomas 2021-05-05 11:33:13 UTC
With Tomcat 7 reaching EOL, move the remaining open enhancement requests to Tomcat 8.
Comment 5 Mark Thomas 2024-03-11 14:49:32 UTC
The original report is almost 10 years old.

300ms for an application with 1800 JARs doesn't sound like much of a saving to me (which is why I asked for the absolute start up times with and without the patch rather than the relative times).

Given the size of the patch for what appears to be marginal improvement and the time that has passed, I'm resolving this as WONTFIX.
Comment 6 Mark Thomas 2024-03-11 14:53:05 UTC
Note if this is still an issue then a performance issue should be raised against the JRE.