Apache OpenOffice (AOO) Bugzilla – Issue 50263
setDataArray on large arrays completely locks OOo and windows
Last modified: 2013-08-07 15:12:27 UTC
Sirs, setDataArray and getDataArray on large arrays lock not only OOo but effectively shuts down Windows XP. Trying to access the Windows XP taskmanager takes about 30 seconds on a P4 2800 with 256 MB. This simple basic demonstrates what happens when trying to get/set with setDataArray pointing to a whole Calc sheet. Somehow it would be useful, if this in inherent to this function, to have some sort of API protection when trying to access such large arrays. Sample code: sub Main oDoc = ThisComponent oSheets = oDoc.getSheets() oSheet1 = oSheets.getByName("Sheet1") oSheet2 = oSheets.getByName("Sheet2") ' If you want the whole sheet just set (in OOo 2.0).. nColumn = 1 nTimer1 = Timer() 'for nRow = 1 to 65536 ' if nRow / 256 = nColumn then nColumn = nColumn + 1 ' if nColumn > 256 then exit for ' oCell = oSheet1.getCellByPosition(nColumn - 1, nRow - 1).setValue(nRow) 'next nTimer2 = Timer() ' 0 seconds sCellRangeName = "A1:IV10" ' 2 seconds on P4 2800 sCellRangeName = "A1:IV1000" ' 19 seconds on P4 2800 sCellRangeName = "A1:IV10000" ' kills it ' sCellRangeName = "A1:IV65536" oCopyCellRange = oSheet1.getCellRangeByName(sCellRangeName) oPasteCellRange = oSheet2.getCellRangeByName(sCellRangeName) ' and copy/paste all cells oPasteCellRange.setDataArray(oCopyCellRange.getDataArray) nTimer3 = Timer() 'assuming midnight not passed nTotalWriteSeconds = nTimer2 - nTimer1 nWriteMinutes = Fix(nTotalWriteSeconds / 60) nWriteSecondsLeft = nTotalWriteSeconds - nWriteMinutes * 60 nTotalCopyPasteSeconds = nTimer3 - nTimer2 nCopyPasteMinutes = Fix(nTotalCopyPasteSeconds / 60) nCopyPasteSecondsLeft = nTotalCopyPasteSeconds - nCopyPasteMinutes * 60 nTotalSeconds = nTimer3 - nTimer1 nTotalMinutes = Fix(nTotalSeconds / 60) nTotalSecondsLeft = nTotalSeconds - nTotalMinutes * 60 sWrite = "Writing took " + nWriteMinutes + " minutes and " + nWriteSecondsLeft + " seconds." sCopy = "Copy/paste took " + nCopyPasteMinutes + " minutes and " + nCopyPasteSecondsLeft + " seconds." sTotal = "Total operation took " + nTotalMinutes + " minutes and " + nTotalSecondsLeft + " seconds." msgbox sWrite + Chr(13) + sCopy + Chr(13) + sTotal end sub Sample spreadsheet with macro attached. Hope this helps, Marinus.
Created attachment 26843 [details] Spreadsheet with get/setDataArray macro example
Hi Sascha, please have a look at this one, set target accordingly or close. Seems to be a performance problem. IMHO this isn't a real used case because copying a whole filled sheet isn't a real world thing. Frank
targeted OOo later
Hi, This is REAL and very important problem, I think. OOo 2.0, Calc can handle 65536 rows and this is a big feature. But we can't use large data because of this bug. This is REAL problem. I write Java add-on program. And I found same problem ... My program takes 120 seconds for a case of action that MS Excel VBA can finish in 10 seconds. I hope everyone think this important. thanks, Makoto Ono (Japan)
Reset assignee on issues not touched by assignee in more than 2000 days.