Skip to content

Conversation

@OptimumCode
Copy link
Owner

Instead of having a shared reference resolver we now create a new one for each validate method invocation. This removes the shared mutable state when JsonSchema is invoked from multiple threads.

This change should not affect performance much as the reference resolver is created only once per validate method invocation.

Resolves #224

@OptimumCode OptimumCode added the fix Fix for bug label Jan 1, 2025
@OptimumCode OptimumCode enabled auto-merge (squash) January 1, 2025 15:48
@codecov
Copy link

codecov bot commented Jan 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.53%. Comparing base (65960ab) to head (ae3f0c8).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #226   +/-   ##
=======================================
  Coverage   90.52%   90.53%           
=======================================
  Files         133      133           
  Lines        3980     3983    +3     
  Branches     1059     1059           
=======================================
+ Hits         3603     3606    +3     
  Misses         82       82           
  Partials      295      295           

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

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'KMP JSON schema validator'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: ae3f0c8 Previous: 65960ab Ratio
macosArm64.CommonAvgTimeBench.validateDetailed ( {"objectPath":"openapi-invalid.json","schemaPath":"openapi_schema.json"} ) 4195.897892397661 us/op 2633.6733204188486 us/op 1.59
macosArm64.CommonAvgTimeBench.validateFlag ( {"objectPath":"openapi.json","schemaPath":"openapi_schema.json"} ) 1130.3611502570693 us/op 732.0572680586081 us/op 1.54

This comment was automatically generated by workflow using github-action-benchmark.

CC: @OptimumCode

@OptimumCode OptimumCode merged commit d1fbcfb into main Jan 1, 2025
21 checks passed
@OptimumCode OptimumCode deleted the fix/224 branch January 1, 2025 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Fix for bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: thread safety issues during validation

2 participants