Apache OpenOffice (AOO) Bugzilla – Issue 120030
[From Symphony] optimize thumbnail saving to improve odt saving performance
Last modified: 2017-05-20 09:13:07 UTC
From profiling data, SfxObjectShell::GenerateAndStoreThumbnail is to be found occupies too much time than expected.
Do profiling on a sample file(sw_complex_100p.odt, contain many pictures) with rational quantify, data shows SfxObjectShell::GenerateAndStoreThumbnail occpies 25% of total time, and its descendant swflyfrm::paint occupies 24% of total time, so much time is unreasonable, because thumbnail is only the first page's image.
Solution: do limit on swflyfrm::paint. 1. add a varible bIsInGenerateThumbnail in SfxObjectShell. 2. add a member function IsInGenerateAndStoreThumbnail in SfxObjectShell, used to get value of bIsInGenerateThumbnail. 3. at beginning of SfxObjectShell::GenerateAndStoreThumbnail, set bIsInGenerateThumbnail as true to indicate thumbnail is beening generated and stored. 4. at beginning of SwFlyFrm::Paint, get value of bIsInGenerateThumbnail, if is true,get current view area, compared with current fly frame's area, if the two rectangle not intersect, no need repiant, return.
following is test result for sample file sw_complex_100p.odt(manual test), about 30% improvement. old: 5.06 5.09 5.06 5.10 5.04 5.03 4.97 4.97 4.97 5.03 avg:5.03 new: 3.44 3.21 3.40 3.28 3.37 3.34 3.31 3.28 3.22 3.32 avg:3.32
Created attachment 78411 [details] odt saving optimize
change status to "CONFIRMED"
ALG->ORW: Isn't there a way to only paint just the first page in SW?
can you please attach the sample file
patch reviewed, built and tested
Suggest to put it into AOO 3.5.0 release