Skip to content

Conversation

@fdutton
Copy link
Contributor

@fdutton fdutton commented Apr 30, 2023

  • Delays detecting the schema version until actually needed.
  • Reduces the number of redundant calls to CollectorContext.getInstance().
  • Precomputes keyword versions.
  • Replaces the use of HashSet due to poor performance

Resolves #721

Initial validation :11 ms
Iteration 0 (in 2 ms)
Iteration 20 (in 30 ms)
Iteration 40 (in 50 ms)
Iteration 60 (in 68 ms)
Iteration 80 (in 84 ms)
Iteration 100 (in 100 ms)
Iteration 120 (in 112 ms)
Iteration 140 (in 125 ms)
Iteration 160 (in 138 ms)
Iteration 180 (in 150 ms)
Iteration 200 (in 161 ms)
Iteration 220 (in 169 ms)
Iteration 240 (in 176 ms)
Iteration 260 (in 184 ms)
Iteration 280 (in 192 ms)
Iteration 300 (in 202 ms)
Iteration 320 (in 210 ms)
Iteration 340 (in 217 ms)
Iteration 360 (in 224 ms)
Iteration 380 (in 231 ms)
Iteration 400 (in 238 ms)
Iteration 420 (in 250 ms)
Iteration 440 (in 259 ms)
Iteration 460 (in 266 ms)
Iteration 480 (in 273 ms)
END -- time in ms: 280

@codecov-commenter
Copy link

Codecov Report

Merging #731 (606439e) into master (cff8961) will increase coverage by 0.04%.
The diff coverage is 97.11%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##             master     #731      +/-   ##
============================================
+ Coverage     75.34%   75.39%   +0.04%     
+ Complexity     1054     1048       -6     
============================================
  Files           106      106              
  Lines          3630     3637       +7     
  Branches        717      718       +1     
============================================
+ Hits           2735     2742       +7     
+ Misses          617      616       -1     
- Partials        278      279       +1     
Impacted Files Coverage Δ
...rc/main/java/com/networknt/schema/SpecVersion.java 90.90% <ø> (-9.10%) ⬇️
...in/java/com/networknt/schema/CollectorContext.java 84.21% <66.66%> (-0.41%) ⬇️
...n/java/com/networknt/schema/uri/URITranslator.java 81.08% <90.90%> (+8.00%) ⬆️
.../java/com/networknt/schema/utils/JsonNodeUtil.java 64.06% <90.90%> (+1.76%) ⬆️
...etworknt/schema/AdditionalPropertiesValidator.java 72.72% <100.00%> (-0.35%) ⬇️
...main/java/com/networknt/schema/AllOfValidator.java 93.22% <100.00%> (+0.11%) ⬆️
...main/java/com/networknt/schema/AnyOfValidator.java 91.66% <100.00%> (+0.11%) ⬆️
...rc/main/java/com/networknt/schema/IfValidator.java 87.50% <100.00%> (+0.22%) ⬆️
src/main/java/com/networknt/schema/JsonSchema.java 90.32% <100.00%> (+0.04%) ⬆️
...c/main/java/com/networknt/schema/NotValidator.java 73.91% <100.00%> (+1.18%) ⬆️
... and 7 more

@stevehu stevehu merged commit 262d3ee into master Apr 30, 2023
@stevehu stevehu deleted the issue721 branch April 30, 2023 12:54
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.

Significant performance regression in 1.0.80

4 participants