pboettch / json-schema-validator

JSON schema validator for JSON for Modern C++
Other
463 stars 133 forks source link

Fix performance regression from logical combination patch discard #288

Closed sjoubert closed 7 months ago

sjoubert commented 9 months ago

A recent fix to discard patch from invalid logical combination introduced a lot (for large json instance and/or schema) of copies to make a patch backup. On some case, this introduced up to a 100x slower validation time (I observed times from 50ms to 7s on one of my use case).

Resizing the patch object to its previous size avoid unnecessary temporary allocations from the backup object.

pboettch commented 9 months ago

Sorry to hear, indeed: there are not performance regression tests.