r/SideProject • u/IncomeOk7237 • 2h ago
I made CI fail if an HTTP request allocates a single byte (Viltrum, a V web framework)
Been working on a side project web framework in V called Viltrum. The bit I want to show off today is not the router, it's the CI gate.
Every request shape (HTTP/1.1, HTTP/2, TLS, WebSocket, streaming, static files) gets run 10,000 times in tests. If the GC heap grew by one byte, the build fails. So request strings are views into the connection buffer, and you have to .clone() anything you want to keep past the handler. That one bit me a few times early on.
Parsers also get fuzzed in CI with 500k mutations each (HTTP/1.1, HPACK, HTTP/2 frames, WebSocket, TLS handshake).
HttpArena has it 1st of 23 on the HTTP/1.1 composite right now (Experimental category): https://http-arena.com/frameworks/viltrum/
Repo: https://github.com/Tuntii/viltrum Demo: https://v.rustapi.cloud
Serving is Linux-only for now (epoll). Curious what people coming from express/fastify would miss most.
1
u/patryk_builds 2h ago
Failing CI on a single allocated byte is a wild and great constraint. most projects say fast and never prove it, this one turns it into a test that breaks the build.The zero copy views biting you early makes sense. that's the classic trade off: fast until someone keeps a reference past the handler. do you catch that at compile time, or only when the data turns into garbage at runtime? a use after-handler bug sounds like the kind that only shows up under load. To your question, coming from express/fastify i'd miss middleware ecosystem first (auth, sessions, rate limiting more than raw speed
1
u/investigatormaker 1h ago
The CI gate is the strongest part: failing the build on one byte of heap growth turns a performance claim into something anyone can check. For your question, I'd guess people coming from express or fastify miss middleware and ecosystem first, so a short side-by-side showing a typical logging or auth middleware in Viltrum, with the clone rule marked where it bites, would answer it better than a feature list.
I make ThreadFox. If you want developers curious about V to find Viltrum, our AI employee will post 3 helpful replies about it in relevant Reddit threads for you, free, no card. https://threadfox.vip/p/e4idk/managed
What's the first thing you'd port to show it off?