diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-05-20 19:08:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-05-22 09:48:21 +0200 |
commit | 319c57d2af5d26d3910db4b02dca145d8881af44 (patch) | |
tree | 98a1c5529713fd9ff92af9e4fa535ee5a44d8447 /vcl/win | |
parent | 3847676cf616ccce40037444e8386dec059487bf (diff) |
tdf#120837 File saving at least 5 times slower
The problem here is that we never actually hit the maExportGraphics
cache in SvXMLGraphicHelper, even though we are passing the same image
down repeatedly.
There are two bugs here:
(1) BitmapEx::operator== does not return true if we instantiate 2
Graphic objects from the same XGraphic, so change it to use the more
expensive operator==. To mitigate the cost, move the expensive checks to
the bottom of the method.
(2) in order to use an object in std::unordered_map, the object must
implement an equality function and a hash function. If two objects are
equal THEY MUST have the same hash value. Using the Impl* as the hash
value does not satisfy that condition, so rather use the checksum, which
does.
After these fixes, the save time drops to less than a second.
Also make the checksum method look more like the operator== method,
and add a checksum calculation method for SVG data that more accurately
reflects the underlying SVG data.
Change-Id: I4ca0c7bee60b2efa6fe42301e582c7b278022b46
Reviewed-on: https://gerrit.libreoffice.org/72615
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/win')
0 files changed, 0 insertions, 0 deletions