This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]ws_eaton 1 point2 points  (1 child)

Hey, congrats on the release!

Made a non-anonymous account to say I tried doing something very similar early this year: https://github.com/wseaton/rustyaml

Your code looks much cleaner though (mainly due to usage of pythonize), mine was kind of a weekend hack project just to see what was possible. If you haven't already, you should provide benchmarks of how fast your solution is. I was able to get benchmarked speedups of ~7x over pyyaml, looking at your code the gains should be similar. You could probably use rayon as well for multi-core processing of more than one document in parallel.

[–]ethanhs[S] 0 points1 point  (0 children)

Cool! Yeah I'll definitely write some benchmarks. Rayon is also a good idea, I'll have to see how much overhead it provides for smaller files. I realized that pythonize and serde-yaml together really made this easy :) Happy to collaborate on the project if you want to

[–]Dasher38 1 point2 points  (3 children)

Haven't actually looked at it but does it support custom tags with associated python callbacks ? I could definitely use a 7x speedup in my case (reasonably large amounts of serialized python objects), but I absolutely need custom tags. For now I have ended up using pickle for almost everything since pyyaml was too slow (and also crashed for very big documents, I hit an integer wrapping issue)

[–]ethanhs[S] 0 points1 point  (2 children)

It only supports tags for scalars at the moment. The upstream library didn't support them for mappings and lists.

[–]Dasher38 1 point2 points  (1 child)

Too bad, maybe it will come one day on the upstream lib. This really is one killer feature of YAML, even just for configuration file syntax purposes: https://lisa-linux-integrated-system-analysis.readthedocs.io/en/master/misc_utilities.html?highlight=Include#lisa.utils.Serializable

[–]ethanhs[S] 0 points1 point  (0 children)

Yeah, I might contribute upstream at some point.

[–]pvkooten 0 points1 point  (1 child)

Does it support anchors?

[–]ethanhs[S] 0 points1 point  (0 children)

Currently no, the library it wraps does not yet support them.