| Summary: | performance problems with ExportedPackageImpl constructor | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | Sangjin Lee <sjlee0> | ||||
| Component: | Framework | Assignee: | Thomas Watson <tjwatson> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | jgawor, jwross, tjwatson | ||||
| Version: | unspecified | ||||||
| Target Milestone: | Juno M1 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 351438 | ||||||
| Attachments: |
|
||||||
|
Description
Sangjin Lee
It would be interesting to see the before and after metrics from your performance tests. Hi, thanks for investigating this issue. Any patch would be appreciated! I recommend getting rid of the "specVersion" field on ExportedPackageImpl altogether and simply calling exportedPackage.getVersion().toString() when needed. BTW, there are currently null checks for the return value of exportedPackage.getVersion(), this is unnecessary since getVersion() must not return null. All packages have a version, the default version is 0.0.0 if not specified. The performance improvement is pretty significant. One of our test cases is the first page performance of a typical-sized JSP in our app running in Geronimo 3.0 for example. The first page invocation triggers JSP compilation, which in turn exercises Class.forName() and ultimately the package admin service as part of the dynamic classloading. We see roughly ~ 30% performance improvement with that use case. Other use cases like OBR resolution and stuff like that also benefit from this, but to a varying degree. Created attachment 199208 [details]
proposed patch
I attached the proposed patch. I'm not sure if the null check in toString() is still needed, but left it in. Also, I repeated the method call of exportedPackage.getVersion().toString() in toString() instead of calling getSpecificationVersion(), as it looks like getSpecificationVersion() is deprecated. Thanks!
Thanks Sangjin! I think we can safely remove the null check in toString() but other than that the patch looks good. I will remove the null check before releasing. Fixed in git master: http://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=6e8d1f0f7061a652f25da8f4fbf5cd4c666fb250 Comment on attachment 199208 [details]
proposed patch
thanks for the contribution!
|