Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 327871

Summary: Performance in JSP Editor
Product: [WebTools] WTP Source Editing Reporter: Joachim Piketz <pik>
Component: jst.jspAssignee: jst.jsp <jst.jsp-inbox>
Status: CLOSED DUPLICATE QA Contact: Nick Sandonato <nsand.dev>
Severity: blocker    
Priority: P3 CC: thatnitind
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Modified file
none
The stack during the long running operation none

Description Joachim Piketz CLA 2010-10-15 06:09:46 EDT
In our very large workspaces, the JSP Editor responds very slow. 
The reason is that the taglib resides not in the same project as the JSP file. So the TLD is searched within the build path
in org.eclipse.jst.jsp.core.taglib.ProjectDescription.resolve(). It takes 30 seconds to open a JSP file or insert a new HTML element.

The solution is to search the TLD in the XML catalog before searching the TLD in the build path.
Comment 1 Joachim Piketz CLA 2010-10-15 06:11:48 EDT
Created attachment 180938 [details]
Modified file

XML Catalog checked before build path
Comment 2 Joachim Piketz CLA 2010-10-15 06:24:05 EDT
Created attachment 180940 [details]
The stack during the long running operation

Name: main
State: RUNNABLE
Total blocked: 58  Total waited: 192

Stack trace: 
java.io.FileInputStream.readBytes(Native Method)
java.io.FileInputStream.read(Unknown Source)
java.io.FilterInputStream.read(Unknown Source)
java.io.PushbackInputStream.read(Unknown Source)
java.util.zip.InflaterInputStream.fill(Unknown Source)
java.util.zip.InflaterInputStream.read(Unknown Source)
java.util.zip.ZipInputStream.read(Unknown Source)
java.util.zip.ZipInputStream.closeEntry(Unknown Source)
java.util.zip.ZipInputStream.getNextEntry(Unknown Source)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.updateJAR(ProjectDescription.java:2268)
org.eclipse.jst.jsp.core.taglib.ProjectDescription$Indexer.visit(ProjectDescription.java:217)
org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:64)
org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:127)
org.eclipse.core.internal.resources.Resource.accept(Resource.java:74)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.index(ProjectDescription.java:1417)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.restoreReferences(ProjectDescription.java:1906)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.<init>(ProjectDescription.java:670)
org.eclipse.jst.jsp.core.taglib.TaglibIndex.createDescription(TaglibIndex.java:757)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.addBuildPathReferences(ProjectDescription.java:722)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.addBuildPathReferences(ProjectDescription.java:723)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.addBuildPathReferences(ProjectDescription.java:723)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.addBuildPathReferences(ProjectDescription.java:723)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.addBuildPathReferences(ProjectDescription.java:723)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.addBuildPathReferences(ProjectDescription.java:723)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.addBuildPathReferences(ProjectDescription.java:723)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.addBuildPathReferences(ProjectDescription.java:723)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.addBuildPathReferences(ProjectDescription.java:723)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.addBuildPathReferences(ProjectDescription.java:723)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.addBuildPathReferences(ProjectDescription.java:723)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.addBuildPathReferences(ProjectDescription.java:723)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.addBuildPathReferences(ProjectDescription.java:723)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.addBuildPathReferences(ProjectDescription.java:723)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.addBuildPathReferences(ProjectDescription.java:723)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.addBuildPathReferences(ProjectDescription.java:723)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.addBuildPathReferences(ProjectDescription.java:723)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.addBuildPathReferences(ProjectDescription.java:723)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.addBuildPathReferences(ProjectDescription.java:723)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.addBuildPathReferences(ProjectDescription.java:723)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.addBuildPathReferences(ProjectDescription.java:723)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.addBuildPathReferences(ProjectDescription.java:723)
org.eclipse.jst.jsp.core.taglib.ProjectDescription.resolve(ProjectDescription.java:1832)
org.eclipse.jst.jsp.core.taglib.TaglibIndex.internalResolve(TaglibIndex.java:938)
org.eclipse.jst.jsp.core.taglib.TaglibIndex.resolve(TaglibIndex.java:578)
org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager.getCacheKey(TLDCMDocumentManager.java:686)
org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager.getCMDocument(TLDCMDocumentManager.java:701)
org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager$DirectiveStructuredDocumentRegionHandler.enableTags(TLDCMDocumentManager.java:121)
org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager$DirectiveStructuredDocumentRegionHandler.enableTaglibFromURI(TLDCMDocumentManager.java:111)
org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager$DirectiveStructuredDocumentRegionHandler.processTaglib(TLDCMDocumentManager.java:404)
org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager$DirectiveStructuredDocumentRegionHandler.processRegionCollection(TLDCMDocumentManager.java:175)
org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager$DirectiveStructuredDocumentRegionHandler.nodeParsed(TLDCMDocumentManager.java:191)
org.eclipse.wst.xml.core.internal.parser.XMLSourceParser.fireNodeParsed(XMLSourceParser.java:135)
org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser.parseNodes(JSPSourceParser.java:296)
org.eclipse.wst.xml.core.internal.parser.XMLSourceParser.getDocumentRegions(XMLSourceParser.java:173)
org.eclipse.wst.sse.core.internal.text.StructuredDocumentReParser._core_reparse_text(StructuredDocumentReParser.java:310)
org.eclipse.wst.sse.core.internal.text.StructuredDocumentReParser.core_reparse(StructuredDocumentReParser.java:710)
org.eclipse.jst.jsp.core.internal.parser.JSPReParser.reparse(JSPReParser.java:143)
org.eclipse.wst.sse.core.internal.text.StructuredDocumentReParser.reparse(StructuredDocumentReParser.java:1291)
org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.updateModel(BasicStructuredDocument.java:2709)
org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.internalReplaceText(BasicStructuredDocument.java:1923)
org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2419)
org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2404)
org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.replaceText(JobSafeStructuredDocument.java:135)
org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replace(BasicStructuredDocument.java:2364)
org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.replace(JobSafeStructuredDocument.java:98)
org.eclipse.jface.text.projection.ProjectionTextStore.replace(ProjectionTextStore.java:111)
org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1184)
org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210)
org.eclipse.jface.text.projection.ProjectionDocument.replace(ProjectionDocument.java:629)
org.eclipse.jface.text.DefaultDocumentAdapter.replaceTextRange(DefaultDocumentAdapter.java:248)
org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7172)
org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:7986)
org.eclipse.swt.custom.StyledText.doContent(StyledText.java:2459)
org.eclipse.swt.custom.StyledText.handleKey(StyledText.java:5932)
org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5962)
org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5656)
org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1103)
org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1099)
org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1508)
org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4268)
org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:345)
org.eclipse.swt.widgets.Control.windowProc(Control.java:4160)
org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
org.eclipse.swt.widgets.Display.windowProc(Display.java:4873)
org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2362)
org.eclipse.swt.internal.BidiUtil.windowProc(BidiUtil.java:639)
org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2459)
org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3655)
org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
org.eclipse.equinox.launcher.Main.run(Main.java:1407)
org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Comment 3 Joachim Piketz CLA 2010-10-15 06:26:33 EDT
The posted "solution" assumes that the TLD is registered in the XML catalog . This would work fine in our workspaces.
Seems to be similar to https://bugs.eclipse.org/bugs/show_bug.cgi?id=317249
Comment 4 Nick Sandonato CLA 2010-10-15 08:48:37 EDT
Hi Joachim,

Thanks for your report. Based on the information you've provided, this sounds like Bug 321602. In Bug 321602 comment 10, we've included a feature patch that you should be able to apply to your Helios service release 1 installation to resolve this high CPU usage.

*** This bug has been marked as a duplicate of bug 321602 ***
Comment 5 Joachim Piketz CLA 2010-10-18 03:37:40 EDT
The feature patch works, thank you very much!