Performance of loading hundreds of timezones on startup

Description

I've been profiling the startup time of Lucee inside of CommandBox on JSR-223 and one of the stack traces that's come up several times now is this:

I looked in TimeZoneConstants.java and it's calling TimeZone.getTimeZone() over 500 times on startup! Each call appears to read a file in which adds up after doing it 500-600 times. Is there a faster way to get this information, or can we delay getting this into until it's used the first time? Perhaps it can be cached also. I assume this is data that doesn't change often, if at all.

Environment

None

Activity

Brad Wood 
23 March 2018 at 17:52

only see stacktraces going through "lucee.runtime.engine.InfoImpl" ?

In my case, I was only testing Lucee startup and every time the stack trace came up, it was as show in the description. The only difference being which timezone was being accessed.

Surely Lucee doesn't actually need all of these contstants just to load. Can they be lazy loaded on first use and then cached for later usage?

Michael Offner 
23 March 2018 at 07:33

making the use in Info obsolete will not solve the problem, because it is still used when loading the config (via TimeZoneUtil).

Michael Offner 
23 March 2018 at 07:28

only a handful of the timezone constants are actually used in the code, except the class TimeZoneUtil, that uses all of them.

Michael Offner 
23 March 2018 at 07:22

converted ticket to a Bug because bad performance is a bug.

Fixed

Details

Assignee

Reporter

Priority

Fix versions

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

Created 23 March 2018 at 05:20
Updated 12 April 2018 at 15:30
Resolved 23 March 2018 at 09:25