Skip to content

v0.2.1: Lighter to load 🪨

Latest

Choose a tag to compare

@frenck frenck released this 13 Jun 20:13
Immutable release. Only release title and notes can be modified.
4e129b0

🪨 A lighter rock to pick up.

v0.2.0 made YAMLRocks run in parallel. v0.2.1 makes it quicker to even get going.

It turns out import yamlrocks was quietly pulling in asyncio (and through it ssl, logging, and friends) just to keep the async_* helpers ready, even if you never touched them. On a one-shot run that loads a small config and exits, that single import was most of the wall-clock time: enough to make us the slowest library on tiny files despite having the fastest parser. A bit embarrassing for a rock that brags about speed.

asyncio is now imported lazily, only when you actually await one of the async helpers. import yamlrocks drops from roughly 25 ms to roughly 2.5 ms, about 10x quicker, and the sync path carries none of it. A regression test keeps it honest.

Big thanks to @pdecat for the sharp diagnosis, -X importtime receipts and a cross-library, fresh-process benchmark included.

pip install yamlrocks

📚 Docs: https://yaml.rocks

Same rock. Quicker to pick up. 🪨

../Frenck

                       

Blogging my personal ramblings at frenck.dev

What's changed

🚀 Enhancements

  • âš¡ Import asyncio lazily so import yamlrocks stays cheap @frenck (#53)