Title:
Interfaces are still slow, continuously checked if modified (implementedInterfacesChanged/getLastModifiedTime)
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/Fixed
Reporter/Name(from Bugbase): Jonas Meller / Jonas Meller ()
Created: 05/08/2017
Components: Performance
Versions: 2016
Failure Type: Performance Issue
Found In Build/Fixed In Build: 2016.0.03.301771 / 2018.0.0.306958
Priority/Frequency: Normal / Some users will encounter
Locale/System: / Windows 7 64-bit
Vote Count: 1
PROBLEM DESCRIPTION:
I was using the sampler in Java VisualVM to analyze the performance of our application and noticed that a lot of time was spent in coldfusion.compiler.NeoTranslator.getLastModifiedTime(). On further investigation I discovered that this seems to be caused by the use of interfaces. Another person reported this issue almost 5 years ago (https://tracker.adobe.com/#/view/CF-3334174) but the issue was deferred (until never?).
STEPS TO REPRODUCE:
MyInterface.cfc:
<cfinterface></cfinterface>
MyComponentWithImplements.cfc:
<cfcomponent implements="MyInterface" output="false"></cfcomponent>
MyComponentWithoutImplements.cfc:
<cfcomponent output="false"></cfcomponent>
test.cfm:
<cfset startTickCount = GetTickCount() />
<cfloop from="1" to="10000" index="i">
<cfset CreateObject('component', 'MyComponentWithoutImplements') />
</cfloop>
<cfoutput>Created 10000 instances of MyComponentWithoutImplements in #GetTickCount() - startTickCount# ms.<br /></cfoutput>
<cfset startTickCount = GetTickCount() />
<cfloop from="1" to="10000" index="i">
<cfset CreateObject('component', 'MyComponentWithImplements') />
</cfloop>
<cfoutput>Created 10000 instances of MyComponentWithImplements in #GetTickCount() - startTickCount# ms.<br /></cfoutput>
ACTUAL RESULT:
With "Trusted cache" checked and "Cache template in request" checked (fastest run):
Created 10000 instances of MyComponentWithoutImplements in 5 ms.
Created 10000 instances of MyComponentWithImplements in 443 ms.
With "Trusted cache" unchecked and "Cache template in request" checked (fastest run):
Created 10000 instances of MyComponentWithoutImplements in 5 ms.
Created 10000 instances of MyComponentWithImplements in 729 ms.
With "Trusted cache" unchecked and "Cache template in request" unchecked (fastest run):
Created 10000 instances of MyComponentWithoutImplements in 389 ms.
Created 10000 instances of MyComponentWithImplements in 1059 ms.
EXPECTED RESULT:
No significant difference between MyComponentWithoutImplements and MyComponentWithImplements.
ANY WORKAROUNDS:
Don't use interfaces.
Attachments:
Comments: