Title:
Bug 81154:Creating spreadsheets using spreadsheetAddRows() is too slow to be used for anything other than the lightest production use
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): marc esher / marc esher (marcesher)
Created: 12/11/2009
Components: Document Management, Office Integration
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 0000 / 264214
Priority/Frequency: Major / Unknown
Locale/System: English / Win All
Vote Count: 21
Problem:
Creating spreadsheets using spreadsheetAddRows() is too slow to be used for anything other than the lightest production use. Creting a 100-row spreadsheet takes consistently a second or more for me. Creating a 500-row spreadsheet takes consistently 20+ seconds. 1000 rows takes @100 seconds. Attempting several thousand rows will hang my CF ServerCompare this performance with Ben Nadel's "POIUtility.cfc" (http://www.bennadel.com/projects/poi-utility.htm). I have it creating 60000-row spreadsheets in under 30 seconds.I'm attaching code that shows the difference in time using CF's built-in spreadsheet generation compared with POIUtility.cfc.
Method:
<cfparam name="url.rowcount" default="100"><cfscript>cfssPath = expandPath("cfss.xls");poiPath = expandPath("poi.xls");columnList = "one,two,three,four";if(fileExists(cfssPath)) fileDelete(cfssPath);q = QueryNew(columnlist,"VarChar,VarChar,VarChar,VarChar");for(i=1; i <= url.rowcount; i++){queryAddRow(q);for(col=1; col <= 4; col++){ colName = listGetAt(columnList,col);querySetCell(q,colName,"#colName#_#col#"); }}writeOutput("Recordcount: #q.RecordCount# <br>");/*cfssStart = getTickCount();ss = SpreadsheetNew("fakedata");spreadsheetAddRows(ss,q);spreadsheetWrite(ss,cfssPath);writeOutput("Total CF spreadsheet time: #getTickCount()-cfssStart# <br>");*/poiStart = getTickCount();poi = createObject("component","POIUtility");poi.writeSingleExcel(FilePath=poiPath,Query=q,ColumnList="one,two,three,four",ColumnNames="One,Two,Three,Four");writeOutput("Total POIUtility time: #getTickCount()-poiStart# <br>");</cfscript>
Result:
SpreadsheetAddRows too slow to be used for production applications
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3040586
External Customer Info:
External Company:
External Customer Name: marc esher
External Customer Email: 70390EBF47F01CAF992015B9
External Test Config: 12/11/2009
Attachments:
Comments: