3 ms·
One recent example of this is Synapse, the Matrix messaging server. Synapse was generally considered to be inefficient and a huge memory hog, so they have been
by ptx 10y ago
One recent example of this is Synapse, the Matrix messaging server.
Synapse was generally considered to be inefficient and a huge memory hog, so they have been experimenting with various ways to rewrite it in Go, saying[1] at the end of last year:
"Synapse is in a relatively stable state currently ... we’re starting to hit some fundamental limitations of the architecture: ... python’s single-threadedness and memory inefficiency; ...; the fact the app papers over SQL problems by caching everything in RAM (resulting in synapse’s high RAM requirements); ..."
But in January[2] it was discovered, during the investigation of another problem, that the vast majority of the memory usage was due to a bug:
"It’s also revealed the root cause of why Synapse’s RAM usage is quite so bad – it turns out that it actually idles at around 200MB with default caching, but there’s a particular codepath which causes it to spike temporarily by 1GB or so – and that RAM is then not released back to the OS."
I wonder if they would still have started the Go rewrite if it hadn't been for that bug. (It seems the new implementation has a better architechture and is substantially faster, so I guess it's still a good idea though, but maybe not as urgent as before?)
[1] https://matrix.org/blog/2016/12/26/the-matrix-holiday-special-2016-edition/ https://matrix.org/blog/2016/12/26/the-matrix-holiday-specia...
[2] https://matrix.org/blog/2017/01/06/synapse-0-18-6-is-out-please-upgrade-especially-if-on-0-18-5/ https://matrix.org/blog/2017/01/06/synapse-0-18-6-is-out-ple...
- Namrog84 10y agoThis is a great example of why you can't take perf related issues intuitively or at face value. Profiling and in depth analysis is always needed. I wonder if this could have been more easily spotted earlier on if a better analysis was done.
- BurningFrog 10y agoSo the analysis of why it was slow was just informed guesswork. One thing I keep learning again and again: You never know what the performance problem is until you've measured it.
- Arathorn 10y agoWe would absolutely still be doing the go-rewrite: while fixing that bug improved the memory usage, it didn't help actual performance much. Meanwhile Dendrite (the rewrite) is currently benchmarking 2 orders of magnitude faster than Synapse. Unfortunately Synapse's architecture simply has many design efficiencies :)