3 ms·
What is "zero-cost" garbage collection?
by bendmorris 8y ago
What is "zero-cost" garbage collection?
- swiftcoder 8y agoI've seen both Rust's lifetimes/borrow-checker and Objective-C/Swift's automatic reference counting described as "zero cost" (since the bulk of the work is done at compile time).
- m0th87 8y agoRust's borrow checker is zero-cost because it's not doing runtime analysis. But it's not a garbage collector, unless you're using Steve Klabnik's "static garbage collector" terminology [1]. Reference counting is definitely not zero cost. It reduces GC runtime latency for most workloads, but not to zero, and it does so at the cost of reduced bandwidth. 1: https://words.steveklabnik.com/borrow-checking-escape-analysis-and-the-generational-hypothesis https://words.steveklabnik.com/borrow-checking-escape-analys...