Community
Participate
Working Groups
Build: Callisto 3.2 I opened a 200KB WSDL file in the WSDL editor. Once the editor is opened, the WSDL validator kicks in and validates the WSDL file. The WSDL validator in turn triggers the WS-I validator. Although the validation runs at the background. My Eclipse workbench is pretty much un-usable because the WS-I validator is using 100% of the CPU. My observation is that the WS-I validator is reloading the same WSDL file each time an assertion is processed. I did a thread dump while the validator was running, here's the stack track for the WS-I validator: "Worker-13" prio=6 tid=0x190e2cd8 nid=0xa80 runnable [0x1b82e000..0x1b82fa68] at org.apache.xerces.dom.ParentNode.internalInsertBefore(Unknown Source) at org.apache.xerces.dom.ParentNode.insertBefore(Unknown Source) at org.apache.xerces.dom.NodeImpl.appendChild(Unknown Source) at org.apache.xerces.parsers.AbstractDOMParser.characters(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanContent(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.eclipse.wst.wsi.internal.core.xml.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:144) at org.eclipse.wst.wsi.internal.core.xml.XMLUtils.parseXML(XMLUtils.java:323) at org.eclipse.wst.wsi.internal.core.xml.XMLUtils.parseXMLDocument(XMLUtils.java:167) at org.eclipse.wst.wsi.internal.core.xml.XMLUtils.parseXMLDocument(XMLUtils.java:146) at org.eclipse.wst.wsi.internal.core.profile.validator.impl.wsdl.AP2908.validate(AP2908.java:66) at org.eclipse.wst.wsi.internal.core.profile.validator.impl.BaseValidatorImpl.processAssertions(BaseValidatorImpl.java:311) at org.eclipse.wst.wsi.internal.core.profile.validator.impl.wsdl.WSDLValidatorImpl.processBindingAssertions(WSDLValidatorImpl.java:757) at org.eclipse.wst.wsi.internal.core.profile.validator.impl.wsdl.WSDLValidatorImpl.validate(WSDLValidatorImpl.java:225) at org.eclipse.wst.wsi.internal.core.analyzer.BasicProfileAnalyzer.validateWSDL(BasicProfileAnalyzer.java:377) at org.eclipse.wst.wsi.internal.core.analyzer.BasicProfileAnalyzer.validateConformance(BasicProfileAnalyzer.java:210) at org.eclipse.wst.wsi.internal.core.analyzer.Analyzer.validateAll(Analyzer.java:198) at org.eclipse.wst.wsi.internal.analyzer.WSDLAnalyzer.validateConformance(WSDLAnalyzer.java:158) at org.eclipse.wst.wsi.internal.validate.wsdl.WSDLValidator.validate(WSDLValidator.java:285) at org.eclipse.wst.wsdl.validation.internal.ValidationController.validateExtensionValidators(ValidationController.java:254) I then did a little test by adding a System.out in the parseXMLDocument(...) method of XMLUtils.java. Results shows that the parseXMLDocument(...) method is called 601 times and each time it will reload the same WSDL file. My console output: ... 596 file:///D:/wtp_151_0712/runtime-New_configuration-build/d/200KB.wsdl 597 file:///D:/wtp_151_0712/runtime-New_configuration-build/d/200KB.wsdl 598 file:///D:/wtp_151_0712/runtime-New_configuration-build/d/200KB.wsdl 599 file:///D:/wtp_151_0712/runtime-New_configuration-build/d/200KB.wsdl 600 file:///D:/wtp_151_0712/runtime-New_configuration-build/d/200KB.wsdl 601 I suggest we cache the WSDL document at: org.eclipse.wst.wsi.internal.core.profile.validator.impl.BaseValidatorImpl.processAssertions(BaseValidatorImpl.java:311) and pass the cached WSDL document into each of the assertion.
The performance is bad enough that I think it deserves a P2 and we should fix it for 1.5.1. I'll attach the 200KB WSDL file. Btw, the WS-I validator took > 5 mins on my machine to validate the 200KB WSDL file.
Created attachment 46545 [details] 200KB WSDL file
I talked to Dave about this bug, he indicated that there should be some caching involved for the document. However, I couldn't find any. Basically, when XMLUtils is called, it will instantiate a org.eclipse.wst.wsi.internal.core.xml.jaxp.DocumentBuilderImpl, which does not have any caching build into it. Then this document builder will create an instance of org.eclipse.wst.wsi.internal.core.xml.dom.DOMParser, which again does not have any caching. I've created a patch that caches the document in the parser. I'll attach the patch, please review. Thanks.
Created attachment 46722 [details] Patch for org.eclipse.wst.wsi
Created attachment 46723 [details] Patch for org.eclipse.wst.wsi Here's a better patch. We can be more efficient with BP2700 and BP2703. BP2700 - Do not re-parse the WSDL if the validator already parsed it. BP2703 - We don't have to re-parse the WSDL (and its schemas) for every matching namespace. We just have to do it once. So I added a couple of "break" statements after the WSDL (and its schemas) are parsed.
Created attachment 46761 [details] Patch for org.eclipse.wst.wsi (from Dave Lauzon)
Dave, thanks for the patch. I have committed and released it to CVS.
verified and close.