News for hackers. Stuff that matters.
Re:Apple is rewriting Foundation in Swift by cellularmitosis on Monday May 22, 2023 @01:21AM (#36027738)
> without a big performance hit.

You might be surprised (I was). Most of the benchmarks I’ve seen place it more in the neighborhood of golang and v8, rather than the C, C++, rust neighborhood you might expect.

Another commenter in this thread highlighted that the ref-counting GC is what keeps it out of the C / Rust performance neighborhood.

Re:Apple is rewriting Foundation in Swift by aatd86 on Monday May 22, 2023 @01:30AM (#36027768)
I remember seeing a few benchmarks where v8 and go were competitive or sometimes even slightly more performant.

So not even sure that GC has always a perf cost is always true.

Not saying it doesn't in some cases, just so that we are clear but the truth seems to be more nuanced.

Re:Apple is rewriting Foundation in Swift by pkulak on Monday May 22, 2023 @02:34AM (#36028153)
Ref-counting GC is pretty slow. It’s great for avoiding stop-the-world pauses, which can be really important for UI stuff like what Swift is used for, but you won’t win any throughput awards.
Re:Apple is rewriting Foundation in Swift by scns on Monday May 22, 2023 @03:36AM (#36028470)
So well engineered for its use case. Was Go optimized for throughput?
Re:Apple is rewriting Foundation in Swift by retendo on Monday May 22, 2023 @03:47AM (#36028530)
Swift doesn't have a GC. The automatic reference counting is a feature that just inserts retain/release statements at compile time, so there is no additional process that handles that. I would suspect that the performance hits originate from other things.
Re:Apple is rewriting Foundation in Swift by cellularmitosis on Monday May 22, 2023 @07:54AM (#36030191)
I don’t see a lot of utility in policing an overly narrow definition of what constitutes garbage collection.
Re:Apple is rewriting Foundation in Swift by frizlab on Wednesday May 24, 2023 @12:41PM (#36060649)
ARC is a type of GC though.