finds.dev← search

// the find

Allenxuxu/gev

★ 1,775 · Go · MIT · updated Jun 2025

🚀Gev is a lightweight, fast non-blocking TCP network library / websocket server based on Reactor mode. Support custom protocols to quickly and easily build high-performance servers.

gev is a Go network library that implements the Reactor pattern using epoll (Linux) and kqueue (macOS/BSD) to handle TCP connections with a small, fixed goroutine pool instead of one-goroutine-per-connection. It sits in the same niche as gnet and evio, targeting servers where you expect thousands of concurrent connections and want to minimize scheduler overhead. Custom framing protocols plug in via a simple two-method interface.

The Protocol interface is genuinely well designed — UnPacket/Packet separation means you implement framing once and the event loop handles the rest, including partial reads via the ring buffer. SO_REUSEPORT support lets you run multiple processes on the same port for zero-downtime restarts without a proxy. The ring buffer implementation is dynamically expanding, so you don't need to guess a max message size upfront. Benchmarks are reproducible — shell scripts and competing servers (gnet, evio, eviop) are included in the repo, not just cherry-picked screenshots.

The repo has gone quiet: last meaningful commit activity is sparse and issues sit unanswered, which matters for a low-level networking library where kernel behavior changes and Go runtime scheduler changes can silently break things. WebSocket support is a plugin bolted on top rather than a first-class concern, and the implementation vendors a partial ws library instead of using gobwas/ws or nhooyr.io/websocket, so you inherit its bugs. There's no TLS support at all — you'd need to proxy through something else, which defeats some of the performance argument. The `ctx interface{}` passing through OnMessage is an escape hatch that turns protocol state into an untyped grab-bag; bigger protocol implementations get messy fast.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →