Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ An engine-correctness release, driven by what the [probatorium](https://github.c
- **Edge-triggered epoll** — per-core event loops with CPU pinning.
- **Adaptive meta-engine** — transplants between io_uring and epoll at runtime based on telemetry.
- **First-party database drivers** — native [`driver/postgres`](driver/postgres), [`driver/redis`](driver/redis), and [`driver/memcached`](driver/memcached) run on the celeris event loop (see [Database drivers](#database-drivers)).
- **SIMD HTTP parser** — SSE2 (amd64) and NEON (arm64) with a generic SWAR fallback.
- **Zero-copy HTTP/1.1 parser** — the parser returns header and body slices that alias the bytes it parses instead of copying them. On epoll and io_uring, a request that arrives whole in one read, with no body or a `Content-Length` body, and runs inline is parsed in place in the engine's read buffer; a request that spans reads, has a chunked body, or runs on an async handler is served from a per-connection buffer instead.
- **HTTP/2 cleartext (h2c)** — full stream multiplexing, flow control, HPACK, inline handler execution, zero-alloc HEADERS fast path.
- **Auto-detect** — protocol negotiation from the first bytes on the wire.
- **Error-returning handlers** — `HandlerFunc` returns `error`; structured `*HTTPError` carries status codes.
Expand Down
35 changes: 0 additions & 35 deletions protocol/h1/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,38 +84,3 @@ func BenchmarkParseRequest_Pipelined(b *testing.B) {
}
}
}

func BenchmarkFindHeaderEnd(b *testing.B) {
sizes := []int{64, 256, 1024, 4096}
for _, size := range sizes {
b.Run(fmt.Sprintf("size=%d", size), func(b *testing.B) {
// Place \r\n\r\n at the end
buf := make([]byte, size)
for i := range buf {
buf[i] = 'A'
}
copy(buf[size-4:], "\r\n\r\n")
b.SetBytes(int64(size))
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
findHeaderEnd(buf)
}
})
}
}

func BenchmarkFindHeaderEnd_8K(b *testing.B) {
size := 8192
buf := make([]byte, size)
for i := range buf {
buf[i] = 'A'
}
copy(buf[size-4:], "\r\n\r\n")
b.SetBytes(int64(size))
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
findHeaderEnd(buf)
}
}
12 changes: 7 additions & 5 deletions protocol/h1/doc.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// Package h1 implements a zero-copy HTTP/1.1 parser.
//
// This is a low-level parser package consumed by the celeris engine layer
// (engine/iouring, engine/epoll, engine/std bridge); application code
// should not import it directly. The parser returns header and body slices
// that alias the connection's read buffer — callers must materialize
// (clone) any value they retain past the next [ParseRequest] call on the
// same connection.
// (engine/epoll and engine/iouring, through internal/conn; the std engine
// uses net/http's parser); application code should not import it directly.
// The parser returns header and body slices that alias the buffer passed to
// [Parser.Reset]: an engine's read buffer, or a per-connection buffer the
// engine gathered the request into. Callers must materialize (clone) any
// value they retain past the next [Parser.ParseRequest] call on the same
// connection.
//
// # Documentation
//
Expand Down
1 change: 0 additions & 1 deletion protocol/h1/findheader.go

This file was deleted.

16 changes: 0 additions & 16 deletions protocol/h1/findheader_amd64.go

This file was deleted.

158 changes: 0 additions & 158 deletions protocol/h1/findheader_amd64.s

This file was deleted.

6 changes: 0 additions & 6 deletions protocol/h1/findheader_arm64.go

This file was deleted.

85 changes: 0 additions & 85 deletions protocol/h1/findheader_arm64.s

This file was deleted.

16 changes: 0 additions & 16 deletions protocol/h1/findheader_generic.go

This file was deleted.

2 changes: 1 addition & 1 deletion protocol/h1/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (p *Parser) ParseRequest(req *Request) (int, error) {
return 0, nil
}

// No upfront whole-block findHeaderEnd scan: parseHeaders detects an
// No upfront whole-block CRLFCRLF scan: parseHeaders detects an
// incomplete block itself (a final line with no CRLF yields lineEnd==-1 →
// (false,nil)), and every caller Reset()s parser+req before re-parsing, so
// a partial parse is always retried cleanly. Scanning here first would
Expand Down
Loading
Loading