[Libreoffice] Performance improvements for calcs' sheet actions
Kohei Yoshida
kohei.yoshida at gmail.com
Sun Jun 5 10:23:19 PDT 2011
Hi Markus,
On Sat, Jun 4, 2011 at 8:04 PM, Markus Mohrhard
<markus.mohrhard at googlemail.com> wrote:
> I would like to here any suggestions before I change anything UI related.
So, there are two things that I could see us changing.
One is to update the progress bar only once per sheet, instead of once
per column in each sheet. I find the latter simply a bit silly, not
to mention it has terrible performance consequences.
Two is to change ScDocument::MoveTab to not instantiate the ScProgress
instance on every call (and destroys it), but to simply have the
caller do that while the method itself simply accepts a pointer to
that instance. When a NULL pointer is passed, the method would simply
do its thing without even updating the progress bar. This would allow
the caller to control how often the progress bar should be updated,
which allows the caller to e.g. update the progress bar on every 5
sheets while relocating 1000 sheets. etc. That would also solve the
issue you had with the unit test code.
The key is to not eliminate the progress bar, but simply reduce the
frequency of updating which can be very expensive especially when
using GTK to draw the progress bar.
How does that sound?
> P.S. We don't even use a ScProgress in ScDocument::CopyTab which should
> normally need much more time
True. I think the reason why MoveTab uses the progress bar may be
because it gets called repeatedly in a for-loop sometimes. Still, the
current design can be improved for better performance (as I stated
above).
Kohei
More information about the LibreOffice
mailing list