Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360428 - HTML Generator is slow
Summary: HTML Generator is slow
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Huang Ji Yong CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-10 08:09 EDT by Tony Chen CLA
Modified: 2017-02-23 14:17 EST (History)
2 users (show)

See Also:


Attachments
html gen performance improvement (30.43 KB, patch)
2011-10-10 08:10 EDT, Tony Chen CLA
lasher: iplog+
Details | Diff
The updated fix (31.49 KB, patch)
2011-10-11 10:11 EDT, Huang Ji Yong CLA
lasher: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Chen CLA 2011-10-10 08:09:01 EDT
HTML Generator normally takes 3 seconds to gen a simple handler on my machine. I profiled with YourKit and found that IRUtils.getReferencedPartsFor() is taking most of the execution time. And HTMLGen is calling that function several times (in generateIncludeFiles, generateDependentFilePath, generatePropertiesFiles & generateCSSFiles). I did not see any easy way to improve getReferencedPartsFor() itself, so I tried to cache result and reuse it in one HTML Gen transaction. It has reduced HTML gen time from 3 seconds to less then a seconds for me. 

I'm attaching my patch here. Jiyong, please verify it and if you feel ok, please deliver it. 

Problems to be resolved:
  In RUITemplate.generateDependentFilePath(). the order is not guarantee. I put a TODO there. We may need to figure out this before delivering the fix. 
  The code in TypeTemplate is not called anymore. I did not know what this piece of code is used for. Something might be broken.
Comment 1 Tony Chen CLA 2011-10-10 08:10:16 EDT
Created attachment 204874 [details]
html gen performance improvement
Comment 2 Huang Ji Yong CLA 2011-10-10 22:08:30 EDT
The order is critical, we must fix that before commit the change.
I think we can remove TypeTemplate now.
Another 2 changes I think we can make to this patch
1. If we remove Service/Interface template, we have to filter these types out before invoking genOutPutFileName.
2. Leave libraryTemplate, because genPropFiles makes no sense for a handler, it should be in a library.

Add Yun Feng to cclist, he may have more comments.

(In reply to comment #0)
> HTML Generator normally takes 3 seconds to gen a simple handler on my machine.
> I profiled with YourKit and found that IRUtils.getReferencedPartsFor() is
> taking most of the execution time. And HTMLGen is calling that function several
> times (in generateIncludeFiles, generateDependentFilePath,
> generatePropertiesFiles & generateCSSFiles). I did not see any easy way to
> improve getReferencedPartsFor() itself, so I tried to cache result and reuse it
> in one HTML Gen transaction. It has reduced HTML gen time from 3 seconds to
> less then a seconds for me. 
> 
> I'm attaching my patch here. Jiyong, please verify it and if you feel ok,
> please deliver it. 
> 
> Problems to be resolved:
>   In RUITemplate.generateDependentFilePath(). the order is not guarantee. I put
> a TODO there. We may need to figure out this before delivering the fix. 
>   The code in TypeTemplate is not called anymore. I did not know what this
> piece of code is used for. Something might be broken.
Comment 3 Huang Ji Yong CLA 2011-10-11 10:11:43 EDT
Created attachment 204952 [details]
The updated fix
Comment 4 Huang Ji Yong CLA 2011-10-11 10:15:55 EDT
Merge the fix of first patch of Tony, an updated patch form Tony to fix the dependent order and other small changes in comment 2.
Test it for all the widgets, do not find any regression defect of HTML gen.
Comment 5 Tony Chen CLA 2011-10-12 02:50:03 EDT
refactored PartReferenceCache according to Brian's suggestion. 

It's now reusing IRUtil.getReferencedPartsFor().
Comment 6 Tony Chen CLA 2011-10-20 07:44:00 EDT
close this.