Based on the comments it seems like the intention was to call reserve(). While resize to 0 does not decrease capacity() (and therefore no memory is de-allocated), the constructor and destructor for each element is still called. Since the struct also contains a vector the overhead of constructing and destructing is compounded.
After looking at the commit history, it seems like the comment is very poorly phrased. It would be more clear if the comment stated something along the lines of "force a page fault now to avoid it during runtime"
Based on the comments it seems like the intention was to call
reserve()
. While resize to 0 does not decreasecapacity()
(and therefore no memory is de-allocated), the constructor and destructor for each element is still called. Since the struct also contains a vector the overhead of constructing and destructing is compounded.