YAML is all over the place. Kubernetes, GitHub Actions, Docker Compose, infrastructure as code.

But what level of overhead should a tool that's checking configuration files actually have?

I built oxyaml (a native YAML language server and CLI checker in Rust) as a way of exploring that very question.

The results

On a generated 50,000-line Kubernetes file:

Operation yaml-language-server oxyaml
Edit diagnostics 1,040 ms 2.6 ms
Warm open 1,064 ms 103 ms
Completion 81.1 ms 1 ms
Peak memory 1,345 MiB 91.4 MiB

Measured on GitHub Actions over 5 sessions. The comparison includes the existing server's default 200ms validation delay.

Compatibility is harder than performance

A fast language server is of no use if the answers it gives are wrong.

Oxyaml uses differential testing on around 4000 real world YAML files to compare its behaviour against yaml-language-server.

The implementation makes use of incremental document reparsing, parallel schema validation and explicit resource limits for potentially expensive YAML and schema structures.

Intentional behavioural differences are documented and regression tested.

One engine, multiple environments

I also wanted developers to use the same validation engine outside of their editors.

Install oxyaml:

pip install oxyaml 

Validate a repository:

oxyaml check . 

Generate SARIF results for CI:

oxyaml check --format sarif . > oxyaml.sarif 

A warm cache benchmark ran 4202 files in around 1.6 seconds on an Intel Core i7-2600 (2011).

Try it in your editor

Oxyaml is available on the VS Code Marketplace and Open VSX, with setup instructions for a number of other editors as well.

Existing yaml-language-server users can switch the server command to oxyaml --stdio and keep their YAML settings and schema associations.

I'm interested in the edge cases - large manifests, odd schemas, complex YAML structures and editor specific behaviour.

If you've got a YAML file that's making your tooling go absolutely mental, I'd be very interested to test it.

GitHub: https://github.com/marwanvx/oxyaml

Benchmark methodology: https://github.com/marwanvx/oxyaml/blob/main/docs/benchmarks.md

Website: https://oxyaml.velixsoft.net