Bug 78067 - Poor ODP save caused by swapping in all images (pointlessly)
Summary: Poor ODP save caused by swapping in all images (pointlessly)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
4.2.0.0.alpha0+ Master
Hardware: Other All
: medium critical
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: perf
Depends on: Image-Caching
Blocks: Save
  Show dependency treegraph
 
Reported: 2014-04-29 08:45 UTC by Michael Meeks
Modified: 2019-10-28 10:43 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
export- showing a ton of reading of images (but no writing) (376.25 KB, image/png)
2014-04-29 08:45 UTC, Michael Meeks
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meeks 2014-04-29 08:45:07 UTC
It takes me a very long time to save my 88 slide deck (much longer than to load it) - you can load it as hybrid PDF here:

http://people.gnome.org/~michael/data/2014-04-26-story-of-libreoffice.pdf

Profiling it in callgrind overnight (yes it takes that long ;-) it turns out that ~all of that time is consumed -loading- and de-compressing the images - there is ~zero cost for exporting them (so I can only think that the binary data is copied directly across to the new container - which is good).

That is really silly =) and (perhaps) another example of the really unfortunate image handling design we have [ though it could just be a silly bug I guess ].
Comment 1 Michael Meeks 2014-04-29 08:45:49 UTC
Created attachment 98165 [details]
export- showing a ton of reading of images (but no writing)
Comment 2 Michael Meeks 2014-05-24 20:55:45 UTC
Interestingly the slowest conversion in our callgrind tests at:

http://dev-builds.libreoffice.org/callgrind_report/

is 051_fdo#73300.odt-convert - whose profile shows a huge amount of time spend loading, un-compressing and checksumming images - but virtually no time converting/exporting them. Which is perhaps another interesting data point.
Comment 3 QA Administrators 2015-06-08 14:42:54 UTC Comment hidden (obsolete)
Comment 4 QA Administrators 2016-09-20 10:02:02 UTC Comment hidden (obsolete)
Comment 5 Michael Stahl (allotropia) 2017-11-23 21:10:12 UTC
this should be substantially improved with:

commit a03a0cfb1e41c357950a40623c2f8b6f5507e97d
Author:     Michael Stahl <mstahl@redhat.com>
AuthorDate: Fri Jul 14 14:32:22 2017 +0200

    sw: make SwGrfNode::mpReplacementGraphic swappable
    
    Same as previous commit, but for sw.
    
    Change-Id: Id678de3f512204437e37aaedf24e24aff7a9e592

commit c96e3e226fe4eb8f25c54cce4d653d12eda63ce2
Author:     Michael Stahl <mstahl@redhat.com>
AuthorDate: Wed Jul 12 15:14:48 2017 +0200

    svx: make SdrGrafObj::mpReplacementGraphic swappable
    
    These GraphicObjects clog up the GraphicManager cache so it's
    effectively useless.
    
    Round-tripping the ML bugdoc, this doesn't provide much of a
    speed-up by itself, but together with the previous fix it goes from
    3:00 to 1:30 (in an optimized build).
    
    Change-Id: If52e176c790b94ffef9984be53376a34345b06e3

commit b3992ddcd13082a934246b717ae22f57394e6533
Author:     Michael Stahl <mstahl@redhat.com>
AuthorDate: Thu Jul 13 21:58:48 2017 +0200

    xmloff: ODF export: fix redundant setting of GraphicStreamURL swapping
    
    XMLShapeExport::ImpExportGraphicObjectShape() unnecessarily swaps out
    the GraphicObject by calling setPropertyValue("GraphicStreamURL")
    even if the URL didn't actually change from what was retrieved
    just a couple lines earlier, incidentally swapping it in too.
    
    Well actually it isn't really swapped out, it's marked as auto-swapped,
    but nevertheless on getting the "ReplacementGraphicURL" property
    its Graphic will be replaced by swapping it in again.
    
    So don't do that, then it's only swapped in once.
    
    This speeds up round-tripping the ML bugdoc from 3:20 to 3:00.
    
    Change-Id: I65a211a0c225444c06d5516df9c6716360be46c0
Comment 6 QA Administrators 2018-11-24 03:43:56 UTC Comment hidden (obsolete)
Comment 7 Julien Nabet 2019-05-30 07:13:05 UTC
On pc Debian x86-64 with master sources updated today, it takes less time to save the pdf file in another file than loading it.
(perhaps 1/2 min to load, 30 secs to save with Ryzen 2600 + 32GB)

Michael Meeks: any update with a recent LO version and following Michael Stahl's comment?
Comment 8 Michael Meeks 2019-10-28 10:43:22 UTC
Oh - lets close it if the work has been done =) nice work Michael.