Issue 120030

Summary: [From Symphony] optimize thumbnail saving to improve odt saving performance
Product: performance Reporter: lizh.fee
Component: wwwAssignee: jsc
Status: CLOSED FIXED QA Contact:
Severity: Normal    
Priority: P3 CC: Armin.Le.Grand, chao.dev.h, issues, jsc, liushenf, orw
Version: AOO 3.4.0   
Target Milestone: 4.0.0   
Hardware: PC   
OS: All   
Issue Type: ENHANCEMENT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
odt saving optimize lizh.fee: review?

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