3 ms·
Ya this article is terrible. You can use RAII with arena allocation, and you can also defer RAII cleanup to avoid stalls. Manually calling cleanup functions a
by TinkersW 2y ago
Ya this article is terrible.
You can use RAII with arena allocation, and you can also defer RAII cleanup to avoid stalls.
Manually calling cleanup functions also has the exact same potential for stalls.
Also perf wise, the only time huge destructor chains are generally triggered is during shutdown. In my app I run millions of destructors on shutdown and it takes about 1 millisecond, it is hardly a noticeable stall. Most of the time during shutdown is actually spent writing & compressing save/cache files, which is irrespective of RAII.