Bubke Marco wrote: > So you optimized the container for growing with allocations. I don't think > it is the most common case. Having cache misses in traversing the > container can be much worse and is much harder to fix than a reserve.
Almost all my containers grow with allocations. How should I know in advance how much memory to reserve? It'd just waste an arbitrary amount of memory and then still end up reallocating because it'll inevitably be exceeded at some point. Variable-size containers are variable-size for a reason. I consider reserve() to be a technical detail and a micro-optimization I really should not have to bother with in 99+% of the cases. Kevin Kofler _______________________________________________ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development