From: Alessio Podda Date: Thu, 22 May 2025 22:53:48 +0000 (+0000) Subject: chg: dev: Adaptive memory allocation strategy for qp-tries X-Git-Tag: v9.21.9~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc3a1bde6587ea63b72821edb93aefe93a036d1d;p=thirdparty%2Fbind9.git chg: dev: Adaptive memory allocation strategy for qp-tries qp-tries allocate their nodes (twigs) in chunks to reduce allocator pressure and improve memory locality. The choice of chunk size presents a tradeoff: larger chunks benefit qp-tries with many values (as seen in large zones and resolvers) but waste memory in smaller use cases. Previously, our fixed chunk size of 2^10 twigs meant that even an empty qp-trie would consume 12KB of memory, while reducing this size would negatively impact resolver performance. This commit implements an adaptive chunking strategy that: - Tracks the size of the most recently allocated chunk. - Doubles the chunk size for each new allocation until reaching a predefined maximum. This approach effectively balances memory efficiency for small tries while maintaining the performance benefits of larger chunk sizes for bigger data structures. Merge branch 'alessio/qp-small-alloc' into 'main' See merge request isc-projects/bind9!10245 --- dc3a1bde6587ea63b72821edb93aefe93a036d1d