But we weren’t satisfied with simply matching Go’s performance. After a bit of profiling and performance optimizations, we were able to beat Go on every single performance metric. Latency, CPU, and memory were all better in the Rust version.
The Rust performance optimizations included:
1. Changing to a BTreeMap instead of a HashMap in the LRU cache to optimize memory usage.
2. Swapping out the initial metrics library for one that used modern Rust concurrency.
3. Reducing the number of memory copies we were doing.
пока переписывали ещё и структуры данных пооптимизировали и попрофайлили…. а так да, только язык заменили =)