Bug 201481 - improve jsp action validator performance
Summary: improve jsp action validator performance
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: jst.jsp (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2.3   Edit
Assignee: Rakesh CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2007-08-28 17:15 EDT by Amy Wu CLA
Modified: 2010-11-02 18:05 EDT (History)
3 users (show)

See Also:
nsand.dev: review+


Attachments
patch (993 bytes, patch)
2010-11-02 04:42 EDT, Rakesh CLA
nsand.dev: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Amy Wu CLA 2007-08-28 17:15:19 EDT
jsp action validator performance can be improved

1)
background: the validator currently attempts to validate all action tags by first checking if the current tag has a "known" jsp prefix.  it then calls model.getIndexedRegion() which is a costly method to call.  after that, it attempts to get the content model for the node and verify the tag.

problem: a "known" jsp prefix is basically any custom tag declared for the jsp whether the tag library actually exists or not (ie whether the uri for the custom tag's taglib directive actually resolves to anything) so if you have a file full of custom tags, but the taglib directive for the custom tag doesnt actually point to anything, you end up calling model.getIndexedRegion() a lot only to result to no validation can be done (looking up content model for tag will reveal the custom tag does not really resolve to anything)

solution: when compiling the list of "known" jsp prefixes, make sure to only include prefixes for tag libraries that actually resolve to something

2) 
problem: during source validation, when a tag is modified, the validator passes in 2 dirty regions, the start tag region and the end tag region.  the jsp action validator looks up the structureddocumentregion for both and gets the same region and ends up validating the same tag twice.

solution: fix would be to check if the region passed in is part of the start tag.  if not, no need to validate.
Comment 1 Amy Wu CLA 2008-10-27 04:16:51 EDT
reassigning to inbox
Comment 2 Ian Tewksbury CLA 2010-01-22 15:33:07 EST
These improvements definitely seem worth looking into.
Comment 3 Rakesh CLA 2010-11-02 04:42:57 EDT
Created attachment 182193 [details]
patch

Patch for problem 1.I was not able to reproduce problem 2.
Comment 4 Nick Sandonato CLA 2010-11-02 18:05:08 EDT
Thanks, Rakesh.