Just make it scale: An Aurora DSQL story
12 points by mjb
12 points by mjb
I’m surprised that the Rust version of the Adjudicator is 10x faster than the Kotlin version: I didn’t think the JVM is that slow! I wonder where the performance wins came from, because I doubt it can be entirely from jettisoning the JIT and GC. Did they rearrange the data structures for less allocation and less pointer indirection?
I think most of the difference comes from the difference in allocations, copies, etc between normal/idiomatic Java and normal/idiomatic Rust. I don’t doubt that a JVM performance expert could have squeezed 10x out of the Kotlin version, but that would likely have made the code both less idiomatic and possibly less safe (e.g. by moving buffer zeroing into the program code).
We had a similar experience with one of the AWS Lambda components: the first Java version struggled on tail latency, while the first Rust version easily saturated a 25Gbit NIC with <10ms p99.99. Idiomatic Rust with good libraries is an easy route to great performance. That doesn’t mean such performance is impossible on the JVM - we know it’s possible, but it seems to require more effort.
(Disclaimer: I work on the DSQL team at AWS).
I’ve been poking at Meilisearch (Rust) a bit and I’d be curious to see the memory and speed differences between that and Elastic Search (JVM). It would not be surprising to see a similar performance difference between the two.