Data structures often allocate without user control, so this may be hard to achieve in many cases. For instance, in Julia I cannot fill a Dict using a preallocated backing buffer; other languages make this easier.
Another example is that view
s can allocate without user approval and hurt performance [RFC/ANN] Restacker.jl: A workaround for the heap-allocated-immutable problem?.