3 ms·
There are some optimizations that do thus. When you know the object won't outlive the function, allocate it on thw stack instead of on the heap And on the more
by ufo 7y ago
There are some optimizations that do thus. When you know the object won't outlive the function, allocate it on thw stack instead of on the heap
And on the more extreme case you can even replace the objects with a bunch of local variables. For example, replace a Point object allocated on the stack with a pair of variables gor the x and y coordinates.