Just One Function, 10x Faster? Reading a Rust Performance PR
Summary
The article details a Rust performance PR for GreptimeDB's Prometheus remote read path, showing how borrowing from Arrow arrays and avoiding per-row allocations can dramatically speed up RecordBatch to TimeSeries conversion. It explains why the old approach copied strings for every row, how dictionary-encoded columns added overhead, and how the new borrowed approach plus a hash-based grouping achieved 4-16x speedups across benchmarks. The piece also discusses considerations for maintaining observable behavior and potential further optimizations.