Community
Participate
Working Groups
In profiling, I found that during validation we spend quite a bit of time repeatedly calling the WorkspaceContextResolver to get the resource associated to the IStructuredDocumentContext for the page being validated... via the AttributeValidatingStrategy. The main cost of WorkspaceContextResolver getProject() and getResource() is a call into ModelManagerImpl.getExistingModelForRead() which manages access to shared objects, taking locks, and checking model state. The ModelManagerImpl routine iterates through all known shared model objects (even across projects) trying to find one with a structured doc matching the one we're looking for. For 3.2.3 we can put in some code changes to improve the implementation of WorkspaceContextResolver and routines that call it to reduce the number of calls made to ModelManagerImpl. I will also clone this for a separate bug for Indigo to make additional changes to cache or or get the resource associated to the IStructuredDocumentContext to reduce the number of times we have to call the WorkspaceContextResolver.
Created attachment 183258 [details] patch to reduce number of calls to ModelManagerImpl This patch reworks WorkspaceContextResolver as well as two classes that call this class to reduce the total number of calls to the ModelManagerImpl. Results for the number of calls to ModelManagerImpl from two scenarios: - import a JSF and JSTL project which contains 40 JSP (requiring validation of all pages in project). The pages have approx 50+ expressions and more than 150 attributes total in the tags of a given page. before - 60,182 after - 26,988 - opening one of the pages in the WPE. before - 9,224 after - 3,616 Additional improvements can go into 3.3 and will be tracked in bug 330303.
Great improvements, thanks on investigating them!
Committed changes for 3.2.3 release.