In many cases (e.g. list of tasks) we can make use of the smallvec library to allocate small vectors on the stack instead of on the heap.
https://llogiq.github.io/2018/09/13/smallvec.html