Status/Resolution/Reason: Closed/Won't Fix/
Reporter/Name(from Bugbase): Justin Treher / Justin Treher (Justin Treher)
Created: 08/15/2016
Components: Performance
Versions: 11.0
Failure Type: Performance Issue
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Major / Most users will encounter
Locale/System: English / Win8 Server 64-bit
Vote Count: 3
Problem Description:
ArrayEach in CF11 is vastly different in performance to ArrayEach in CF10.
Steps to Reproduce:
<cfscript>
// test the performance of iterating through an array
// Array converted to ArrayList to pass by reference
// Regular array in CF
// using standard for loop
// Compare CF 10 vs CF11 and CF2016
// CF10 is much faster than the others
// setup our test data
foo = [];
for( i = 1; i<10000; i++){
foo[i] = i;
}
// test 1 : Using ArrayList and ArrayEach
startTimer();
asList = CreateObject( "java", "java.util.ArrayList").init( foo );
ArrayEach( asList, function( e ){
var shoe = asList[e];
});
stopTimer();
startTimer();
ArrayEach( foo, function( e ){
var shoe = foo[e];
});
stopTimer();
startTimer();
size = ArrayLen( foo );
for( i=1; i<=size; i++){
shoe = foo[foo[i]];
}
stopTimer();
function startTimer(){
variables.start = getTickCount();
}
function stopTimer(){
WriteOutput( getTickCount()-variables.start & "<br>");
}
</cfscript>
Actual Result:
Slowness on CF11
Expected Result:
Same performance as CF10
Any Workarounds:
Convert your array to ArrayList first.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4181256
External Customer Info:
External Company:
External Customer Name: Justin Treher
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: