Fixed
Details
Assignee
Michael OffnerMichael OffnerReporter
afteriafteriPriority
CriticalLabels
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
Details
Details
Assignee
Michael Offner
Michael OffnerReporter
afteri
afteriPriority
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 21 March 2019 at 11:02
Updated 21 May 2024 at 19:36
Resolved 21 May 2024 at 19:36
As per described in Lucee developer forums, we found out after switching to Lucee that some of our existing functions that did tons of Replace() and other string functions were extremely slow compared to their execution on OpenBD (even with slower hardware).
This isn't exactly a measurable difference in isolated case, but the function in case was repeated several times in some templates - and those templates were the only ones throwing timeouts to our error logs. Once we replaced the custom function (a customized datetimeformat function replacement) with system's own such function, all the timeouts we have had over the past 14 months, disappeared.
The function had just lots of replaces, nothing more complicated than that and the string it took in, was a short one, basically a date mask:
Short clip from the function:
... <cfset maski=Replace(maski, "January", "tammikuuta", "ALL")> <cfset maski=Replace(maski, "February", "helmikuuta", "ALL")> <cfset maski=Replace(maski, "March", "maaliskuuta", "ALL")> <cfset maski=Replace(maski, "April", "huhtikuuta", "ALL")> <cfif isdefined("kolme")> <cfset maski=Replace(maski, "May", "tou", "ALL")> <cfelse> <cfset maski=Replace(maski, "May", "toukokuuta", "ALL")> </cfif> <cfset maski=Replace(maski, "June", "kesäkuuta", "ALL")> <cfset maski=Replace(maski, "July", "heinäkuuta", "ALL")> <cfset maski=Replace(maski, "August", "elokuuta", "ALL")> <cfset maski=Replace(maski, "September", "syyskuuta", "ALL")> <cfset maski=Replace(maski, "October", "lokakuuta", "ALL")> <cfset maski=Replace(maski, "November", "marraskuuta", "ALL")> <cfset maski=Replace(maski, "December", "joulukuuta", "ALL")> <cfset maski=Replace(maski, "Jan", "tam", "ALL")> <cfset maski=Replace(maski, "Feb", "hel", "ALL")> <cfset maski=Replace(maski, "Mar", "maa", "ALL")> <cfset maski=Replace(maski, "Apr", "huh", "ALL")> <cfset maski=Replace(maski, "Jun", "kes", "ALL")> <cfset maski=Replace(maski, "Jul", "hei", "ALL")> <cfset maski=Replace(maski, "Aug", "elo", "ALL")> <cfset maski=Replace(maski, "Sep", "syy", "ALL")> <cfset maski=Replace(maski, "Oct", "lok", "ALL")> <cfset maski=Replace(maski, "Nov", "mar", "ALL")> <cfset maski=Replace(maski, "Dec", "jou", "ALL")> ...
Now, I suspect that by switching from Lucee's internal Replace() to Java's replace functions on other site areas might improve performance there, too..
Suggest you look into this, even tho it might seem insignificant.