Issue 120030 - [From Symphony] optimize thumbnail saving to improve odt saving performance
[From Symphony] optimize thumbnail saving to improve odt saving performance
Status: RESOLVED FIXED
Product: performance
Classification: Code
Component: www
AOO 3.4.0
PC All
: P3 normal (vote)
: AOO 4.0
Assigned To: jsc
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-19 07:00 UTC by lizh.fee
Modified: 2013-02-16 09:25 UTC (History)
6 users (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation on: ---
Developer Difficulty: ---


Attachments
odt saving optimize (2.80 KB, patch)
2012-06-21 04:51 UTC, lizh.fee
lizh.fee: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description lizh.fee 2012-06-19 07:00:08 UTC
From profiling data, SfxObjectShell::GenerateAndStoreThumbnail is to be found occupies too much time than expected.
Comment 1 lizh.fee 2012-06-20 06:47:53 UTC
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.
Comment 2 lizh.fee 2012-06-20 08:25:31 UTC
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.
Comment 3 lizh.fee 2012-06-21 04:38:29 UTC
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
Comment 4 lizh.fee 2012-06-21 04:51:24 UTC
Created attachment 78411 [details]
odt saving optimize
Comment 5 Yan Ji 2012-06-21 06:44:49 UTC
change status to "CONFIRMED"
Comment 6 Armin Le Grand 2012-06-21 15:50:22 UTC
ALG->ORW: Isn't there a way to only paint just the first page in SW?
Comment 7 jsc 2012-06-22 11:00:43 UTC
can you please attach the sample file
Comment 8 jsc 2012-06-25 09:48:48 UTC
patch reviewed, built and tested
Comment 9 ChaoHuang 2012-10-17 08:20:56 UTC
Suggest to put it into AOO 3.5.0 release