News for hackers. Stuff that matters.
Re:Swift System Is Now Open Source by higerordermap on Friday September 25, 2020 @11:32PM (#24596202)
> - Collections are value types (implemented somewhat efficiently by having copy-on-write collections)

Isn't copy on write data structures mostly discouraged idea these days?

Re:Swift System Is Now Open Source by NobodyNada on Saturday September 26, 2020 @12:37AM (#24596451)
Swift already uses reference counting for memory management, so copy-on-write is basically free -- it just checks to see if the collection's reference count is greater than 1 before writing.
Re:Swift System Is Now Open Source by dmitriid on Saturday September 26, 2020 @03:02AM (#24596964)
It's decidedly not free. Reference counting in Swift can be (is?) a major bottleneck. See this project: https://github.com/ixy-languages/ixy-languages and its discussion on Swift performance: https://github.com/ixy-languages/ixy.swift/blob/master/perfo...
Re:Swift System Is Now Open Source by NobodyNada on Saturday September 26, 2020 @12:06PM (#24599791)
It’s free since the language is already using reference counting. But yes, retain/release traffic is often a huge problem in performance-critical code.