Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330302 - Reduce the number of calls to WorkspaceContextResolver for a resource of a given structured doc context
Summary: Reduce the number of calls to WorkspaceContextResolver for a resource of a gi...
Status: RESOLVED FIXED
Alias: None
Product: Java Server Faces
Classification: WebTools
Component: Core (show other bugs)
Version: 3.2.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2.3   Edit
Assignee: Carlin Rogers CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 330303
  Show dependency tree
 
Reported: 2010-11-15 19:31 EST by Carlin Rogers CLA
Modified: 2010-11-18 02:21 EST (History)
2 users (show)

See Also:


Attachments
patch to reduce number of calls to ModelManagerImpl (5.65 KB, patch)
2010-11-16 14:10 EST, Carlin Rogers CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlin Rogers CLA 2010-11-15 19:31:58 EST
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.
Comment 1 Carlin Rogers CLA 2010-11-16 14:10:19 EST
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.
Comment 2 Yury Kats CLA 2010-11-16 14:27:58 EST
Great improvements, thanks on investigating them!
Comment 3 Carlin Rogers CLA 2010-11-18 02:21:33 EST
Committed changes for 3.2.3 release.