-
Notifications
You must be signed in to change notification settings - Fork 281
Description
Hello,
I'm using this library to validate elements against a large schema (https://www.hl7.org/fhir/downloads.html - https://www.hl7.org/fhir/fhir.schema.json.zip). We noticed a significant (almost 10x!) performance cost when using the validator in our program - mostly because our program has a large-ish stack (or maybe there is some other aspect, other than size of our stack that is causing problems, like asynchronicity) when it does validation, so java.lang.Throwable#fillInStackTrace takes a "long time" to run. Forking the code, and adding
@Override
public synchronized Throwable fillInStackTrace() {
return this;
}
to ValidationException improves performance by almost 10x in our specific application.
Obviously this is not likely to be a good permanent solution (there are probably scenarios where the stack is useful) but being able to trigger this behaviour behind a flag or something would be ideal.
What do y'all think? Is this something we can optimize in the library, or maybe externally at the callsite?