Skip to content

maintain the validator instance to speedup schema validation process#55

Merged
janw merged 3 commits intobcwaldon:masterfrom
yinyinl:yinyinl/validator_instance
Feb 9, 2020
Merged

maintain the validator instance to speedup schema validation process#55
janw merged 3 commits intobcwaldon:masterfrom
yinyinl:yinyinl/validator_instance

Conversation

@yinyinl
Copy link
Contributor

@yinyinl yinyinl commented Feb 4, 2020

Given a schema (and possibly a resolver), jsonschema creates a validator first by compiling the schemas and uses it to validate data. If inside the class object, the validator instance is maintained, the validation overhead can be reduced, instead of creating a new validator every time.

In this PR, test_benchmark in test_core.py is to measure the timing difference for the PR review. It can be removed once we finish reviewing and discussing.

@yinyinl yinyinl requested a review from janw February 4, 2020 17:31
@janw
Copy link
Contributor

janw commented Feb 8, 2020

Hey @yinyinl, thanks! Good catch; please go ahead and remove the benchmark test, I'll be happy to merge this after that. 👍

Copy link
Contributor

@janw janw left a comment

Choose a reason for hiding this comment

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

Just remove the test_benchmark and this is good to go.

@yinyinl
Copy link
Contributor Author

yinyinl commented Feb 8, 2020

Removed the timing benchmark test that was meant for PR review purpose only. Feel free to squash the commits into single one during merging to master. Thanks!

@yinyinl yinyinl requested a review from janw February 8, 2020 20:54
@janw janw merged commit 6f41194 into bcwaldon:master Feb 9, 2020
@yinyinl yinyinl deleted the yinyinl/validator_instance branch February 10, 2020 23:25
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.

2 participants