On Monday, 27 September 2021 at 14:39:36 UTC, Max Samukha wrote: > If performance was important, you would want to allocate the > object itself on the stack? The cost of GC allocation outweighs > that of GC.addRoot by a lot. The cost of GC _collection_ outweighs that of GC.addRoot by a lot. GC _allocation_ is pretty much free.