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
Load faster versions of safe loaders as well #47422
Conversation
Seems like CI doesn't like me:
|
The C versions of the loader/dumper are 5-10x faster than the python versions. We already do this for the "unsafe" ones, this diff simply adds it for the "safe" ones.
Rebased on current master |
@cachedout want me to rebase and try again? |
@rallytime any ideas/details why this one is failing? |
@jacksontj I wasn't able to check these results before they timed out, so I have restarted them. |
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 makes sense. @rallytime any objections with backporting this into 2018.3?
@terminalmage Nope, no objections. Labeled for backport. |
There are a couple of related test failures on this one, however:
@jacksontj Can you take a look? |
I don't know that we're going to be able to merge this. Those failures are happening because we have subclassed the SafeLoader and have made modifications on top of it. Those changes don't work when the CSafeLoader takes the place of the SafeLoader. |
@terminalmage got a way to reproduce the error locally? I'd gladly take some time to dig into it, I'm just unable to repro these failures locally (so maybe some yaml version difference or something). |
@jacksontj Sure. The failure is a test I added to confirm a fix that was made to handle colons in inline python unicode literals, see #47104. And you can reproduce the failure like so:
The reason we needed that fix is because one of the ways people use Salt is using the |
That sounds like we should have made that behavior (loading raw prints of python objects) as a special loader, since that is invalid yaml :/ How tied are we to that behavior? If very, then maybe I can add a "high-perf" loader option that doesn't have that magic behavior? cc: @terminalmage |
The default salt yaml renderer overrides the default python yaml library, which is quite a bit slower. Unfortunately over time a few non-yaml things have been added into the default salt yaml loader (example: saltstack#47422 (comment)). As such it makes it difficult to move to a C-backed implementation without making our own. This simply adds a `cyaml` renderer as an option to salt. With this users can decide to switch to a more strict yaml parser (no python prints) which is ~5-12x faster. Eventually we may decide to make this the default, but by adding this as a renderer option there is no rush to do so.
Superseded by #48194 |
Re-opening. Copy-paste from comment in the other PR:
|
@jacksontj and @terminalmage I think this has been replaced with #48309, yes? |
I'm fairly certain this was replaced by #48309 so I will close this. If I have closed this too quickly, let me know I will re-open. :) Note, there is a merge conflict in |
Your assessment looks accurate :) Thanks! |
The C versions of the loader/dumper are 5-10x faster than the python
versions. We already do this for the "unsafe" ones, this diff simply
adds it for the "safe" ones.