[ http://nagoya.apache.org/jira/browse/XALANJ-917?page=history ]
Henry Zongaro updated XALANJ-917:
---------------------------------
Assign To: (was: Xalan Developers Mailing List)
type: Improvement (was: Bug)
Description:
The current implementation of the CachedXPathAPI object creates XPath object
during the eval(), and provides a "null" ErrorHandling interface.
// Create the XPath object.
XPath xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null);
^^^^
This causes the XPath constructor to create a DefaultErrorHandler. The
DefaultErrorHandler creates a new PrintWriter around System.err. When there are
lots of eval() method calls being made using the CachedXPathAPI object, there
are lots of un-needed DefaultErrorHandlers being created. Through profiling, I
determined that 30% of the CPU utilization associated with calls to eval() were
being attributed to creating the DefaultErrorHandlers.
PROPOSAL:
I propose that you add functionality to either alter the constructor of the
CachedXPathAPI object to accept an ErrorHandler:
public CachedXPathAPI(ErrorHandler); // and variations
or add proper accessor methods to the CachedXPathAPI object:
public ErrorHandler getErrorHandler();
public void setErrorHandler(ErrorHandler errorHandler);
Thanks,
Aaron
was:
The current implementation of the CachedXPathAPI object creates XPath object
during the eval(), and provides a "null" ErrorHandling interface.
// Create the XPath object.
XPath xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null);
^^^^
This causes the XPath constructor to create a DefaultErrorHandler. The
DefaultErrorHandler creates a new PrintWriter around System.err. When there are
lots of eval() method calls being made using the CachedXPathAPI object, there
are lots of un-needed DefaultErrorHandlers being created. Through profiling, I
determined that 30% of the CPU utilization associated with calls to eval() were
being attributed to creating the DefaultErrorHandlers.
PROPOSAL:
I propose that you add functionality to either alter the constructor of the
CachedXPathAPI object to accept an ErrorHandler:
public CachedXPathAPI(ErrorHandler); // and variations
or add proper accessor methods to the CachedXPathAPI object:
public ErrorHandler getErrorHandler();
public void setErrorHandler(ErrorHandler errorHandler);
Thanks,
Aaron
Environment:
Operating System: All
Platform: All
was:
Operating System: All
Platform: All
Priority: Major
Bugzilla Id: (was: 7294)
> Performance Issue - CachedXPathAPI
> ----------------------------------
>
> Key: XALANJ-917
> URL: http://nagoya.apache.org/jira/browse/XALANJ-917
> Project: XalanJ2
> Type: Improvement
> Components: XPath
> Versions: 2.3
> Environment: Operating System: All
> Platform: All
> Reporter: Aaron Hughes
>
> The current implementation of the CachedXPathAPI object creates XPath object
> during the eval(), and provides a "null" ErrorHandling interface.
> // Create the XPath object.
> XPath xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null);
> ^^^^
> This causes the XPath constructor to create a DefaultErrorHandler. The
> DefaultErrorHandler creates a new PrintWriter around System.err. When there
> are
> lots of eval() method calls being made using the CachedXPathAPI object, there
> are lots of un-needed DefaultErrorHandlers being created. Through profiling,
> I
> determined that 30% of the CPU utilization associated with calls to eval()
> were
> being attributed to creating the DefaultErrorHandlers.
> PROPOSAL:
> I propose that you add functionality to either alter the constructor of the
> CachedXPathAPI object to accept an ErrorHandler:
> public CachedXPathAPI(ErrorHandler); // and variations
> or add proper accessor methods to the CachedXPathAPI object:
> public ErrorHandler getErrorHandler();
> public void setErrorHandler(ErrorHandler errorHandler);
> Thanks,
> Aaron
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]