How we 250x'd our speed with FastCloneMap
Blog post from Statsig
Statsig has developed an innovative approach to managing dynamic initialize payloads for customers in order to deliver personalized and efficient application experiences, especially as the scale of operations increases. The challenge was maintaining data consistency during requests, which initially required creating a versioned snapshot of a company's data on each request, resulting in significant CPU usage and latency issues for large-scale customers. To address this, Statsig transitioned to a "clone + delta" strategy, which significantly reduced processing time by using previous snapshot data and only applying changes, thus decreasing the time from 500ms to 50ms. The introduction of a new data structure, inspired by Rust’s DashMap library, further optimized performance by reducing the cost of copying data, bringing the processing time down to approximately 2ms. However, this approach comes with trade-offs such as increased initial store creation costs and slightly slower access speed, which are mitigated by the performance benefits gained during operation.