Add may-minihttp — Rust stackful coroutines engine#236
Open
BennyFranciscus wants to merge 2 commits intoMDA2AV:mainfrom
Open
Add may-minihttp — Rust stackful coroutines engine#236BennyFranciscus wants to merge 2 commits intoMDA2AV:mainfrom
BennyFranciscus wants to merge 2 commits intoMDA2AV:mainfrom
Conversation
may-minihttp is a mini HTTP server built on the May coroutine library, which uses stackful coroutines for cooperative scheduling. It follows a coroutine-per-connection model similar to goroutines but in Rust. Implemented as an engine with baseline, pipelined, and limited-conn test profiles. Uses mimalloc allocator and thin LTO for performance. Repo: https://github.com/Xudong-Huang/may_minihttp
may_minihttp's BodyReader only supports Content-Length bodies. Chunked Transfer-Encoding requests crash the connection parser since the chunk framing corrupts subsequent request parsing. Rewritten to use may TCP directly with httparse for header parsing and manual chunked TE decoding. This fixes the CI validate failure on the chunked POST baseline test.
Owner
|
/benchmark baseline |
|
🚀 Benchmark run triggered for |
Benchmark ResultsFramework: Full log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds may-minihttp as a new engine entry. may-minihttp is a mini HTTP server built on the May coroutine library — stackful coroutines in Rust with a coroutine-per-connection model.
This is a really interesting approach — instead of async/await (like tokio/hyper), May uses stackful coroutines similar to goroutines. Each connection gets its own coroutine with cooperative scheduling. The API stays synchronous and blocking-style, but underneath it's all non-blocking I/O with work-stealing. Pretty cool design.
Already does well on TechEmpower benchmarks, curious to see how it stacks up in HttpArena against hyper, actix, etc.
Type
Engine — raw HTTP server with no routing, JSON, compression, or DB abstractions.
Test Profiles
baseline— GET (query param sum) + POST (body parsing)pipelined— returnsoklimited-conn— same endpoints, short-lived connectionsImplementation Details
may_minihttp0.1.11 onmay0.3 (stackful coroutines)num_cpusworkers viamay::config().set_workers()-C target-cpu=native, thin LTO, single codegen unitValidation
Docker build: ✅
All endpoints tested locally:
GET /baseline11?a=10&b=20&c=30→60✅POST /baseline11?a=5&b=10body=100→115✅GET /pipeline→ok✅cc @Xudong-Huang — would love your feedback! The stackful coroutine approach is a really unique take on high-concurrency HTTP serving.