-
Notifications
You must be signed in to change notification settings - Fork 1.3k
perf: switch schema validation library #2796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
voluptuous is compiling schema to python function, which makes it faster.
| Optional(PARAM_REV): str, | ||
| Optional(PARAM_REV_LOCK): str, | ||
| } | ||
| REPO_SCHEMA = {PARAM_URL: str, PARAM_REV: str, PARAM_REV_LOCK: str} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So how does it differentiate required field from an optional one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a Required() wrapper.
|
Switched config validation to voluptuous too, removed the req for schema. |
|
@Suor Please rebase. |
| "nanotime>=0.5.2", | ||
| "pyasn1>=0.4.1", | ||
| "schema>=0.6.7", | ||
| "voluptuous>=0.11.7", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: need to not forget to update it in conda package deps.
ghost
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great 👍
voluptuous is compiling schema to a python function, which makes it around 7x faster for me. This is the second slowest part of stage collection, see #2671.
This only replaces schema validation library for stages, config still uses the old one. There is no point in using both, so if everyone is ok with this switch, I will rewrite the config schema too.