3 ms·
As with everything, you need to use the tool for use-cases that it was designed for. A downside of RAII is the hidden cost of unwinding, and predictability ove
by trap_goes_hot 4y ago
As with everything, you need to use the tool for use-cases that it was designed for.
A downside of RAII is the hidden cost of unwinding, and predictability over CPU usage. If you have a resource that supports complicated internal transformations, and memory states, then you need an equally complicated destructor that can handle all those different states. If you're not careful with this you can get CPU spikes at scope-exits.