Miklos Vajna
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:
-
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.
-
Skip the decoding accessor. SvXMLGraphicHelper::implSaveGraphic() swapped Graphic::GetGfxLink() (which forces ensureAvailable()) for Graphic::GetSharedGfxLink(), which returns the shared mpGfxLink directly.
-
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.
-
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:

