Home / Companies / Honeycomb / Blog / Post Details
Content Deep Dive

How We Saved 70% of CPU and 60% of Memory in Refinery’s Go Code, No Rust Required

Blog post from Honeycomb

Post Details
Company
Date Published
Author
Ian Wilkes
Word Count
976
Language
English
Hacker News Points
-
Summary

Refinery 3.0 is a significant update that enhances performance by improving CPU and memory efficiency, enabling businesses to reduce costs associated with tail-based sampling. The update achieves a 70% reduction in CPU usage and a 60% reduction in RAM usage by changing how data is processed, specifically by avoiding unnecessary de-serialization of trace spans and focusing only on essential fields. This shift from handling data with a map[string]any data structure to a more selective extraction method dramatically reduces computational overhead, as evidenced by benchmarking results. The improvements include transcoding various input data formats directly to MessagePack, optimizing metrics instrumentation, and utilizing buffer pools, with plans to parallelize the decision loop for better CPU scaling. These changes allow Refinery to maintain its functionality while operating more efficiently, ultimately offering substantial cost savings without requiring a complete rewrite in a different programming language.