-
Notifications
You must be signed in to change notification settings - Fork 650
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
GH-2797: Lazy init for ValidationState hash maps #2798
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this allow for possible multithreading issues though? While with the final
map that's mitigated... maybe looking at other data structures/map implementations could solve it in a different way (there's a comment about ligher impl...)
The class is not thread-safe anyway, because We would have to worry about it if we had a shared instance of |
...I mean, I can make this thread-safe, but the real question is "what for" 😆 |
jena-core/src/main/java/org/apache/jena/ext/xerces/impl/validation/ValidationState.java
Outdated
Show resolved
Hide resolved
jena-core/src/main/java/org/apache/jena/ext/xerces/impl/validation/ValidationState.java
Outdated
Show resolved
Hide resolved
jena-core/src/main/java/org/apache/jena/ext/xerces/impl/validation/ValidationState.java
Outdated
Show resolved
Hide resolved
jena-core/src/main/java/org/apache/jena/ext/xerces/impl/validation/ValidationState.java
Outdated
Show resolved
Hide resolved
Maybe add a comment to the javadoc header of the class with: |
464f6e0
to
80c6a5e
Compare
Done. |
GitHub issue resolved #2797
Pull request Description:
This is a conservative solution to #2797 – it does not change any behavior from the outside perspective, and only changes the initialization of these two hashmaps to be lazy.
This should improve RDF parsing performance.
I'm marking "tests are included" because I don't see anything to test here that is not already covered by existing tests.
By submitting this pull request, I acknowledge that I am making a contribution to the Apache Software Foundation under the terms and conditions of the Contributor's Agreement.
See the Apache Jena "Contributing" guide.