Community
Participate
Working Groups
We are using wtp 1.5 in a large plugins related project When you run validation on a web project with 200 jsp's and html files The HTML validator spends nearly 22 seconds out of the 80 seconds it takes to validate in the method NextCatalog.getReferencedCatalog() Name Time (ms) org.eclipse.wst.xml.core.internal.catalog.NextCatalog.getReferencedCatalog() 22,255 100 % org.eclipse.wst.xml.core.internal.catalog.CatalogElement.getAbsolutePath(String) 19,043 86 % org.eclipse.wst.xml.core.internal.catalog.CatalogSet.lookupOrCreateCatalog(String, String) 3,152 14 % On looking at this method, the code does public ICatalog getReferencedCatalog() { return ((Catalog)ownerCatalog).getCatalogSet().lookupOrCreateCatalog(getId(), getAbsolutePath(location)); } The call to the method getAbsolutePath(location) where location is always a constant value "default_catalog" You can retrieve it in and store it in a instance variable the first time. On doing that this method took only 60 milliseconds here is the change private String absolutePath; public String getCatalogLocationAbsolutePath() { if (absolutePath == null) absolutePath = getAbsolutePath(location); return absolutePath; } public ICatalog getReferencedCatalog() { return ((Catalog)ownerCatalog).getCatalogSet().lookupOrCreateCatalog(getId(), getCatalogLocationAbsolutePath()); } Let me know if you need any more profiling information.
Interesting. Definitely sounds like a bug. I'm buzy this week but I'll dig into this next week (and if someone else want's to solve this sooner be my guest). Feel free to send me a nag note if you haven't seen any actitivy on this by the end of next week.
(In reply to comment #1) > Interesting. Definitely sounds like a bug. I'm buzy this week but I'll dig > into this next week (and if someone else want's to solve this sooner be my > guest). Feel free to send me a nag note if you haven't seen any actitivy on > this by the end of next week. > Hi Craig, Any progress. The fix seems safe, and as we had looked in all of the invocations, getAbsolutePath(location) seems to remain the same value, so can be stored lazily in an instance variable as shown below.
I think I have a performance fix for this one. As I mentioned in bug 136399 having examples and JUnit would help me verify. Raj, I assume the same tests/test-cases for 136399 would apply to this one too.
Created attachment 41007 [details] patch to make reduce repeated resolution of the 'nextCatalog'
Hi Craig, Cool ! This patch fixes the problem. I verified it in target -> WTP 1.5 RC3 and org.eclipse.wst.xml.core checked out from the CVS repository with the patch applied. Validation on the project went down from 115 seconds to 67 seconds with the method getReferencedCatalog taking 42 seconds to 0 seconds Please get it in WTP/RAD builds soon. Thanks Raj
Setting target milestone to RC5. This is a safe fix to solve a significant performance problem.
+1 for WTP 1.5 RC5 based on David's review
+1 1.5
Released for RC5. Raj, think this could be related to bug 136399? Perhaps after this applied, you could see if 136399 is still a bug?
I'd like to nominate this bug as a "great bug" ... and, sure ... its just one little performance fix :) but Raj has actually contribute many bug reports, test cases and has gone "above and beyond" by contributing several patches similar to this one that end up "making a differernce for Callisto" ... so therefore deserves a t-shirt that says so :)
This is part of a mass update to close out all stale WTP resolved bugs from the 1.0.x and 1.5.0 timeframe. If you feel this bug was closed inappropriately, please reopen. Thanks, John Lanuti