← Back to context

Comment by saagarjha

3 years ago

Wasn't this the comparison that decided to use reference types for everything for no real reason?

The reason being comparing how various schemes of automatic reference memory management perform.

Naturally if the purpose was to compare stack allocation performance other approach would have been taken.

  • The goal was to write a network driver in several languages. Nobody said anything about comparing memory management techniques, nor would the Swift implementation use a stack allocator anyways.

    • They would appreciate your contribution to fix the benchmark.

      Apparently the ARC performance improvements announced at WWDC 2022 weren't needed.

      3 replies →

I don’t know anything about the benchmark, but how would you test GC implementations without reference types?

  • Swift’s value types have reference counts because they may have members that need their lifetimes to be managed appropriately. (For example, if they’re reference types.)

    • This is incorrect, value types are not referenced counted in Swift. If a value type contains a reference type member (usually an anti pattern!), then that member’s reference count is indeed incremented when the value type is copied. But it is not accurate to claim that value types themselves have reference counts.

      1 reply →