ODT saving performance improvement

From Apache OpenOffice Wiki
Revision as of 09:24, 12 June 2012 by Lilyzh (Talk | contribs)

Jump to: navigation, search


Investigation of ODT saving performance

We started a profiling of the saving performance on a current AOO build with Quantify on Windows. One document(sw_complex_100p.odt) are profiled for a save procedure.

The analysis of the data should be:

  • 1.show, if the profiler output is stable and reproducible
  • 2.identify the hotspots of the current implementation
  • 3.be a basis to evaluate the progress by optimization


For benchmark document: sw_complex_100p.odt, it is consisted of many graphics. Following shows the hotspots(marked in blue) in saving procedure.

From these data, we can know, SfxObjectShell::GenerateAndStoreThumbnail and SwGrfNode::SwapIn occupy too much time than expected.

For SfxObjectShell::GenerateAndStoreThumbnail, we found it will call SwFlyFrm::Paint several times, but it's unnecessary to paint thumbnail when saving.

For SwGrfNode::SwapIn, through analyzing data collected from quantify, one phenomenon is that graphic will be first swapped in, after saving, it will be swapped out. If document contains lots of graphics, it will influence saving performance immensely.

Solution

  • 1.Don't paint thumbnail in saving procedure.
  • 2.Don't swap out and swap in graphics so frequently when saving.

Graphic Management Mechanism

Give a brief description to solution 2.

1.Graphic Manager Graphic Manager is responsible for all graphic objects’ register, unregister, drawing, and graphic’s cache. It is a global variable.

2.Graphic Cache For management of Graphic Cache, Graphic Manager supplies a series of interfaces: graphic object cache size settings, swap graphic in, swap graphic out, swap timer, etc.

  • Contents of graphic cache

Graphic cache includes two parts: one is the image that presents to user, namely graphic’s bitmap or metafile A; the other is when graphic is registered or unregistered, the image that dynamically existing, it is the graphic before it transforming to bitmap or metafile, namely B.

  • Settings of graphic cache

Image that presents to user, namely graphic’s bitmap or metafile A, its size can be set through interface. Below is conventional diagram.

Personal tools