3 ms·
Important to note: this effectively disables garbage collection, and therefore obviously can lead to a LARGE increase in memory usage. In C++, there are kinds
by candiodari 9y ago
Important to note: this effectively disables garbage collection, and therefore obviously can lead to a LARGE increase in memory usage.
In C++, there are kinds of programs where "#define free(x)" results in the same effect, including the large speedup.
But this is an important trick that also works in Java, C++ and Go.
It can be combined further. For instance, where you're keeping track of many small pieces of a big chunk of data, having the big chunk somewhere with a big primitive type array containing the actual data and then having Flywheel pattern accesses to it can result in incredible speeds.