[Development] Question about QCoreApplicationData::*_libpaths

Kevin Kofler kevin.kofler at chello.at
Thu Jan 21 05:44:05 CET 2016


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




More information about the Development mailing list