3 ms·
I guess the more interesting questions is whether it happens at compile time or run-time - ARC definitely injects derefs at compile time and therefore there are
by turbinerneiter 6y ago
I guess the more interesting questions is whether it happens at compile time or run-time - ARC definitely injects derefs at compile time and therefore there are no gc-"pauses" at runtime.
(Right?)
- baq 6y agoif you want to collect cycles, you have to find them, and may cause pauses.
- pjmlp 6y agoThere are always pauses at runtime, when a reference reaching the count of zero starts a domino effect of references being decreased to zero. Which is why in most high performance RC, you get a tracing GC in disguise, because the actual deletion is moved into a background cleaning thread. An example of this in production is the C++/WinRT framework for COM/UWP.
- turbinerneiter 6y agoAh, that's true.
- elcritch 6y agoIn that regard it's not too dissimilar to Rust's semantics when memory is free'ed (https://news.ycombinator.com/item?id=23362518 https://news.ycombinator.com/item?id=23362518). Nim's ARC does inject refs/decrs, but they're not atomic which means it's overhead can be pretty minimal. I don't know if ObjC/Swifts ARC uses atomics or locking. GTK's object system for example uses locking which makes it pretty expensive.