[Libreoffice] Performance improvements for calcs' sheet actions

Markus Mohrhard markus.mohrhard at googlemail.com
Sat Jun 4 17:04:45 PDT 2011

Hello Kohei, all,

I've been looking a bit further into the performance problem when dealing
with several sheets and am now at the move method.(ScDocument::MoveTab)

We have there an ScProgress(for all: it's the calc version of a progress
bar) which is called quite too often. We call for every column at every
sheet ScProgress::SetState. So in the end we are there with number of tables
* MAXCOL (which is 1024 at the moment) calls to SetState. (It gets even
worse when we move several sheets at once: number of moved tables*number of

I tried with 5000 empty tables and moving a sheet from the first position to
the last(most work for the algorithm) and it turns out that we need much
more time updating the progress bar than we need to move the sheet. So in my
opinion there is no need for the progress bar but I like to hear your
opinion on that too. I don't know if you remember that we have problems with
the same progress bar in the unit test, so it would solve two problems at
The other solution would be to update the progress bar only once per sheet
and not once per column.

I would like to here any suggestions before I change anything UI related.


P.S. We don't even use a ScProgress in ScDocument::CopyTab which should
normally need much more time
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110605/0a0e9ac7/attachment.htm>

More information about the LibreOffice mailing list