Story Summary Story
Last updated: 7 days ago
The technology is a high-performance HTTP/1.1 parser and serializer designed for zero heap allocations, leveraging OxCaml's unboxed types and local allocations. Key architectural features include stack-allocated request/span types, local header lists, and span-based parsing using offset/length references into input buffers. It utilizes pre-allocated, reused read buffers and supports bigstring I/O directly.
It adheres to HTTP/1.1 standards, supporting various methods, chunked encoding, and keep-alive. Benchmarks show it significantly outperforms an Eio-based parser (httpe), achieving up to a 3.14x speedup and drastically fewer memory allocations per operation across different request sizes. Timings demonstrate parsing minimal requests in under 210ns with minimal heap usage.
The system includes an asynchronous static file server featuring concurrent connection handling, zero-copy I/O, MIME type detection, and directory protection. Future plans include integrating io_uring support on Linux. Installation requires the OxCaml compiler.
Generating comment summary... This may take a moment.