Adaptive hedged requests for Go. Cut your p99 latency with zero configuration. Based on Google's "The Tail at Scale" paper.
Hedge is a library that speeds up applications by automatically sending backup requests to slow services it calls, learning patterns in real-time to reduce delays.
How It Works
You're building an app that talks to many services, but some slow ones make everything drag—then you find Hedge, a smart helper to speed things up.
Simply wrap your app's connections with Hedge in a couple of lines, no complicated setup needed.
Hedge quietly watches how long each service usually takes, figuring out normal speeds on its own without you lifting a finger.
When one service starts lagging beyond its usual time, Hedge notices right away.
It fires off a quick backup call to the same service, grabbing the faster reply and canceling the slow one.
Hedge keeps a gentle limit on backups to avoid overload and shares simple stats on how often it helps.
Your app now responds lightning-quick and reliably, even with tricky services, all tuned perfectly without effort.
Star Growth
Repurpose is a Pro feature
Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.
Unlock RepurposeSimilar repos coming soon.