Issue 50263 - setDataArray on large arrays completely locks OOo and windows
Summary: setDataArray on large arrays completely locks OOo and windows
Status: CONFIRMED
Alias: None
Product: Calc
Classification: Application
Component: programming (show other issues)
Version: recent-trunk
Hardware: PC All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-03 02:52 UTC by marinus
Modified: 2013-08-07 15:12 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Spreadsheet with get/setDataArray macro example (414.77 KB, application/vnd.oasis.opendocument.spreadsheet)
2005-06-03 02:53 UTC, marinus
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description marinus 2005-06-03 02:52:55 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.
Comment 1 marinus 2005-06-03 02:53:54 UTC
Created attachment 26843 [details]
Spreadsheet with get/setDataArray macro example
Comment 2 frank 2005-06-15 14:59:15 UTC
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
Comment 3 frank 2005-06-22 12:04:48 UTC
targeted OOo later
Comment 4 m_ono_m 2005-07-13 19:40:22 UTC
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)
Comment 5 Rob Weir 2013-07-30 02:17:40 UTC
Reset assignee on issues not touched by assignee in more than 2000 days.