Faster slide copy in Collabora Online Writer

A series of small VCL and xmloff changes has made copying slides between Impress documents in Collabora Online dramatically faster for image-heavy decks.

The bottleneck was surprising: 75% of the time went to uncompressing PNG files just to compute a pixel-checksum. Copying 85 slides took 5100 ms.

Four targeted changes turned that around, each removing an unnecessary image decode:

  1. Checksum on compressed bytes. ImpGraphic::getChecksum() now computes CRC32 over the encoded payload (via a cache on BinaryDataContainer) instead of the decoded pixels: no ensureAvailable() needed to hash an image.

  2. Skip the decoding accessor. SvXMLGraphicHelper::implSaveGraphic() swapped Graphic::GetGfxLink() (which forces ensureAvailable()) for Graphic::GetSharedGfxLink(), which returns the shared mpGfxLink directly.

  3. GraphicID from metadata only. The GraphicID ctor no longer decodes to read alpha and pixel size: it uses hasAlpha() and getSizePixel(), which read from SwapInfo for swapped-out graphics.

  4. PNG-typed GfxLinks skip swap-in. ImpGraphic::getVectorGraphicData() short-circuits for PNG links (which never produce vector data anyway), avoiding the decode entirely.

Result: the 85-slide copy dropped from 5100 ms to 978 ms 19% of baseline.

Performance profile before:

After:

Leave a Reply

We use cookies to help our website work and improve your experience.
Read our Privacy Policy for more details.

We use cookies

We use cookies to improve your experience on this website. You may choose which types of cookies to allow and change your preferences at any time. Disabling cookies may impact your experience on this website. You can learn more by viewing our Cookie Policy.