-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Frequent invocation of javax.xml.stream.XMLOutputFactory::newInstance negatively impacts performance #474
Comments
I have applied a hotfix in the client project but still need to beef it up into a proper pull request. The problematic code in our use case is in My suggestion is to consolidate retrieval and caching of expensive factories into a utility class (maybe |
Thanks Rob! |
We'll let you submit your patch first, then we'll use that as a model for the rest. |
Hi Sam, after some further research it turned out the various XML factories are not guaranteed to be thread-safe. To address this I have reworked pull request #477 to use instance-per-thread caching. The code is a bit verbose as the develop-3.0 branch is still Java 6. But nevertheless, it should be relatively straightforward. |
Thanks Rob! |
@georgeajit as long as this didn't create any issues in unit tests, I think we're good on this |
Don't see any regressions as of now (01/25/2018) on the develop branch. Shipping this issue. |
While profiling a client application, it showed that there are lots of
javax.xml.stream.XMLOutputFactory.newInstance()
invocations, specifically when a client retrieves extracted document data from search results. In our use case, this almost totaled to the same amount of CPU time as the actual search.The text was updated successfully, but these errors were encountered: