Skip to content

Conversation

justin-tay
Copy link
Contributor

This refactors the evaluation context from the validator state. This means that long evaluation chains no longer consume large amounts of memory as the same loaded schemas and validators can be used. The evaluation context is instead stored in the execution context.

This is unfortunately not without a cost. The performance benchmark of the schema and inputs previously used drop from 8000 ops/s to 4600 ops/s. This should still be above Everit's benchmark of around 4000 ops/s.

That said, this tradeoff is still acceptable as it makes the validator more robust in handling certain types of schemas.

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 85.06494% with 92 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.91%. Comparing base (48ca3c2) to head (1cf0bf8).
⚠️ Report is 105 commits behind head on master.

Files with missing lines Patch % Lines
.../schema/keyword/PropertyDependenciesValidator.java 40.00% 10 Missing and 2 partials ⚠️
...networknt/schema/keyword/ItemsLegacyValidator.java 86.56% 8 Missing and 1 partial ⚠️
.../networknt/schema/keyword/DynamicRefValidator.java 62.50% 6 Missing ⚠️
...networknt/schema/keyword/PrefixItemsValidator.java 66.66% 4 Missing and 2 partials ⚠️
src/main/java/com/networknt/schema/Schema.java 93.50% 4 Missing and 1 partial ⚠️
...orknt/schema/keyword/AbstractKeywordValidator.java 83.33% 2 Missing and 3 partials ⚠️
...a/com/networknt/schema/keyword/ItemsValidator.java 58.33% 4 Missing and 1 partial ⚠️
...a/com/networknt/schema/keyword/OneOfValidator.java 81.48% 2 Missing and 3 partials ⚠️
.../main/java/com/networknt/schema/utils/Strings.java 70.58% 2 Missing and 3 partials ⚠️
...in/java/com/networknt/schema/ExecutionContext.java 80.00% 4 Missing ⚠️
... and 17 more
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1199      +/-   ##
============================================
- Coverage     78.90%   77.91%   -1.00%     
+ Complexity     1965     1900      -65     
============================================
  Files           172      199      +27     
  Lines          6352     6596     +244     
  Branches       1255     1164      -91     
============================================
+ Hits           5012     5139     +127     
- Misses          867     1025     +158     
+ Partials        473      432      -41     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@stevehu
Copy link
Contributor

stevehu commented Oct 12, 2025

Totally agree. We should focus on stability to make it enterprise-ready. Thanks a lot for the big effort.

@stevehu stevehu merged commit 9527f4a into networknt:master Oct 12, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants