Optimization

Description

Modules

State

Use of ANY and uno::Reference

Like in the Mail of Daniel Bölzle in the dev.OpenOffice.org mailing list from 16.10.2003 13:30 described the use of Anys can be optimized. A test in the SC project increased the performance by 10 percent, so every module should do this change in the load and save methods.

The main improvements are to use uno::makeAny() in queryInterface instead of

uno::Any aR; aR <<= uno::Reference<x>(this); return aR;

like this:

return uno::makeAny( uno::Reference<x>(this));

I did also all other in the mail described changes. See also http://api.openoffice.org/TipsAndTricks/cpp_uno_coding_hints.html

All

In progress

2 runs to find EditCells

At the moment we have to go over all text cells to find out whether this cells are simple text cells or EditCells where we have to collect the autostyles for. This could be done by a special Interface in the API. So we can use the much time faster core, which knows where the EditCells are instead of getting all text cells, getting the implementation and test whether it is a EditCell. A fast test showed a possible improvement of 20 percent, while commenting out the complete run. A real possible improvement should be 10 percent, because there is something to do to find the EditCells, but it is much faster to make it directly.

SC

Planned

Nothing to do in ScDocument::IdleCalcTextWidth()

At the moment the method IdleCalcTextWidth is called and does a lot of unnecessary things. In a test the method returns directly after calling and the test document is saved 10 percent faster. This is a very simple change and we should do it.

SC

Planned