Show HN: Shields.rs – a Rust badge engine 10x faster than Node.js
I've been working on a project I'd love to share: shields.rs, a high-performance badge rendering engine written in Rust.
The goal was to build something incredibly fast and reliable for services that need to generate a lot of badges. The result is an engine that can render a badge in about 4.5 microseconds, which is over 10 times faster than the popular badge-maker library for Node.js.
A key feature is that the output is bitwise-identical to shields.io. This means you get 100% compatible and consistent SVGs every time. It supports all the styles you'd expect (flat, flat-square, plastic, etc.) and makes it easy to add logos from Simple Icons or your own custom SVG.
The API is designed to be simple and chainable. Here's a quick peek:
``` let badge = Badge::plastic() .label("version") .message("1.0.0") .message_color("#4c1") .build(); ```
I wrote this because I wanted a more performant and type-safe solution for badge generation. It was a fun challenge to optimize the rendering pipeline and SVG generation logic in Rust.
You can check out the source code and benchmarks on GitHub: https://github.com/Jannchie/shields
And the full documentation is on docs.rs: https://docs.rs/shields
I would be grateful for any feedback or questions. What do you think?
No comments yet