Community
Participate
Working Groups
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.
Created attachment 204874 [details] html gen performance improvement
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.
Created attachment 204952 [details] The updated fix
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.
refactored PartReferenceCache according to Brian's suggestion. It's now reusing IRUtil.getReferencedPartsFor().
close this.