logoalt Hacker News

WalterBrighttoday at 12:25 AM2 repliesview on HN

    new_capacity *= 2;
A better value is to increase size by 1.5:

https://stackoverflow.com/questions/1100311/what-is-the-idea...


Replies

burnt-resistortoday at 3:56 AM

Yep. And probably use tcmalloc or jemalloc (deprecated?) too. Most OS sbrk/libc malloc implementations are better than they used to be, but certain profiled programs can increased performance by tuning one of the nonstandard allocators. YMMV. Test, profile, and experiment.

emmelaichtoday at 1:15 AM

I remember reading (decades ago) an extensive article in Software Practice and Experience reaching the same conclusion.

show 1 reply