-
Notifications
You must be signed in to change notification settings - Fork 122
Fixed #1824: Now caching TransformerFactory to prevent countless expensive factory creations #1855
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
base: master
Are you sure you want to change the base?
Fixed #1824: Now caching TransformerFactory to prevent countless expensive factory creations #1855
Conversation
|
While |
a727108 to
2e705e6
Compare
|
As announced recently, here is the benchmark result (please find the source code, build script, and test data attached
This clearly proofs that JAXB-RI unmarshalls much faster using PR-1855 compared to 4.0.6-RI's original code. Both, Saxon and the JRE's original implementation, clearly benefit from this contribution, and Saxon is becoming useable now. Hence, I am hereby removing the draft state, and kindly ask for a merge. 🙂 |
…untless expensive factory creations Signed-off-by: Markus KARG <markus@headcrashing.eu>
2e705e6 to
8aa4b25
Compare
|
@lukasj Kindly requesting your review. :-) |
|
Hard to make a more minimal MRE 😄 |
|
@mkarg : this is what I would have done to fix your performance issue. With actual 4.0.6 :
With patched 4.0.7-SNAPSHOT :
|
|
Feel free to open an alternative PR if you think that yours is in any case better than mine. In the end, I am happy with any solution, as long as it finally solves #1824. 🙂 |
|
Well I don't want to take over your PR since you find the issue and provide a PR My solution (IMHO) offers a retro-compatibility way since we don't know how users would modify cached-instance that would be grabbed outside JaxbContext. And also provide cache handling on |
|
Again, I do not care which solution is picked, so I am okay with you opening another PR and closing mine in turn - as long as we see any solution in the next patch level release. |
|
@eclipse-ee4j/ee4j-jaxb-impl-committers Kindly asking for review / merge. 🙂 |
Closing #1824
Introduces a simple softreference-based cache for
TransformerFactoryto prevent expensive creation of new factories unless the configuration (= setting of security and factory class) has changed or memory was exhausted meanwhile.