3 ms·
I would think destructors would negate some of the performance advantages of GCs, since it's not possible to have zero-cost freeing of objects when destructors
by aidenn0 4y ago
I would think destructors would negate some of the performance advantages of GCs, since it's not possible to have zero-cost freeing of objects when destructors exist.
- pebal 4y agoSGCL executes the destructors in a separate thread, so there is no cost to the mutator.
- aidenn0 4y ago> SGCL executes the destructors in a separate thread, so there is no cost to the mutator. Firstly, that's orthogonal to my original point is that, for example, a semi-space nursery can significantly reduce the cost of short-lived allocations (often being faster than malloc/free on such a workload), but only if there are no destructors. Secondly, threads typically share resources so running something on a different thread does not magically cause it to not disturb the mutator. Such a claim makes me start to doubt the "real-time" claim in the title...
- pebal 4y agoDisruption is a lower cost than the cost of executing the destructor by the mutator.