4 ms·
The latency that this individual was experiencing with Workers wayyyyy back in 2019 was not caused by cold starts, but rather a bug in the workers runtime which
by kentonv 5y ago
The latency that this individual was experiencing with Workers wayyyyy back in 2019 was not caused by cold starts, but rather a bug in the workers runtime which caused rare but long pauses. Specifically, the bug involved a hash map with a broken hash function. Here's me publicly facepalming over the issue at the time: https://twitter.com/KentonVarda/status/1189966124688953344 https://twitter.com/KentonVarda/status/1189966124688953344
But that was two years ago, Workers has grown ~an order of magnitude since then (both traffic and team size), and such a bug would be immediately noticed today.
The article author says that after the fix he still wasn't happy with performance, but I don't know what he was experiencing exactly. We've done a lot of other things to improve performance since then; it may very well be better today.
- lifeofguenter 5y agoI used cloudflare-workers still this year and only switched a couple of months ago: https://securitytrails.com/domain/url.rw/history/a https://securitytrails.com/domain/url.rw/history/a The performance was still very bad from a 95 percentile perspective.
- kentonv 5y agoThis isn't the feedback we get from most customers, so I guess there was something unusual going on. Sorry we weren't able to dig into this while it was still relevant to you.
- ignoramous 5y ago> https://twitter.com/KentonVarda/status/1189966124688953344 https://twitter.com/KentonVarda/status/1189966124688953344 What exactly was the bug though? bool effectively reducing hash(key) to 0 or 1?
- kentonv 5y agoYes. So almost all keys had a hash code of 1, forcing linear search lookups. Insidious since the code still works, it's just slow -- and only really slow in production, after seeming fine in tests that only put a few items in the map.