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

Code review turned a 3x speedup into 8.9x (off-heap HdrHistogram in QuestDB)

Blog post from QuestDB

Post Details
Company
Date Published
Author
Javier Ramirez
Word Count
1,447
Company Posts That Month
4
Language
English
Hacker News Points
-
Post removed?
No
Summary

QuestDB, an open-source time-series database, excels in handling demanding workloads by offering ultra-low latency and high ingestion throughput with its multi-tier storage engine. A recent community-driven enhancement focused on optimizing QuestDB's integration with HdrHistogram by rewriting it as an off-heap, flyweight class. This change aimed to improve the approx_percentile() function's scalability across worker threads without incurring garbage collection or allocator costs on the data path. Initial benchmarks showed a parallel speedup of 3x but revealed a single-threaded regression. After a review and optimization, which involved hoisting configuration-dependent computations out of the hot path, the rewrite achieved a significant improvement, with the single-threaded regression eliminated and parallel performance reaching up to 8.9x. This effort highlighted the importance of community contributions, the trade-offs of off-heap memory management, and the value of collaborative reviews in optimizing performance-critical components.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.