So in my quest to redesign a couple of Matrix protocol things, here's one thing that has been incredibly frustrating...
It's very easy to design deterministic algorithms that are efficient in most cases and only slow in uncommon cases. But those algorithms are completely useless in systems where an untrusted party controls whether something is the slow uncommon case... which is the case for most of a messaging protocol.
And designing deterministic algorithms that are efficient in most *real-world cases*, and resistant to artificial worst-cases... *that* is much more difficult!