new_capacity *= 2;
A better value is to increase size by 1.5:https://stackoverflow.com/questions/1100311/what-is-the-idea...
replies(3):
new_capacity *= 2;
A better value is to increase size by 1.5:https://stackoverflow.com/questions/1100311/what-is-the-idea...
Thus you might see a curve like 13, 32, 56, 86 - this curve is aggressive to start but then much gentler. Because it's so gentle it gets the re-use upside for medium sized allocations but it incurs a lot more copying, I can imagine in Python that might be a good trade.