News for hackers. Stuff that matters.
Re:Proposed New Go GC: Transaction-Oriented Collector by joosters on Friday June 24, 2016 @02:17PM (#11972119)
Each release of Go seems to have yet another garbage collection algorithm, targetting a different use case each time. Presumably the previous use cases are left behind, ready for a future update going back to target them too. This leads to an infinite loop of GC alterations.

Does anyone feel confident that a 'good enough for everyone' GC will ever be produced? If not, surely the language designers should settle on picking a type of program that they will optimise for, and sticking to it.

Re:Proposed New Go GC: Transaction-Oriented Collector by ngrilly on Friday June 24, 2016 @02:37PM (#11972286)
> Presumably the previous use cases are left behind

No, they are not. The optimization discussed here adds something to the existing GC, and removes nothing.

> Does anyone feel confident that a 'good enough for everyone' GC will ever be produced?

The Go GC is constantly improving, and its performance in Go 1.6 and 1.7 is considered very good my most users.

Re:Proposed New Go GC: Transaction-Oriented Collector by vvanders on Friday June 24, 2016 @04:00PM (#11972972)
There's a subthread further down that points to this exact type of regression: https://news.ycombinator.com/item?id=11970313

Without full memory control you're always going to making trade-offs in terms of performance. Hopefully the GC is "good enough" for your use case but there will never be a one-size fits all GC.

Re:Proposed New Go GC: Transaction-Oriented Collector by enneff on Friday June 24, 2016 @10:04PM (#11974845)
FWIW that "regression" looks like a program that depends on particular runtime characteristics to generate "artistic" output. Not really the kind of issue you can realistically develop around.

In almost all practical programs the new GC (in 1.5) was a significant win, or at worst no change.

Re:Proposed New Go GC: Transaction-Oriented Collector by madgar on Friday June 24, 2016 @04:52PM (#11973370)
> The Go GC is constantly improving, and its performance in Go 1.6 and 1.7 is considered very good my most users.

Also true of Ruby or PHP. Which perform abysmally.

"Most users" needs aren't what we look for to define technical excellence - if anything, I most often see "most users" used to guide the compromising of technical standards.

Re:Proposed New Go GC: Transaction-Oriented Collector by enneff on Friday June 24, 2016 @10:06PM (#11974848)
But Go doesn't perform abysmally. The 1.5 GC is technically excellent (ask an expert).

Go does target "most users". That's the demographic. There will always be edge cases for which the general design does not work.

Re:Proposed New Go GC: Transaction-Oriented Collector by oleganza on Friday June 24, 2016 @02:26PM (#11972185)
GC highlight time-memory tradeoff at its worst because GC-based languages typically do not allow programmer to explicitly express his memory model forcing a lot of unnecessary "garbage" to be created. In Ruby all objects that do not fit in a tagged pointer are objects. In Go and Java some types are specifically optimized for being stack-based "value" types that reduces amount of work for GC.

I personally like the "ARC" approach with ObjC and Swift where compiler statically adds and optimizes reference counting routines, promotes objects to stack when possible and requires programmer to manually resolve cyclic references (and Xcode supports nice methods to debug and visualize memory in order to detect unintentional cycles). Accidental memory cycles are rare enough and quite debuggable at a very little mental cost to mark some references as "weak" or "unowned". But the long-term performance and memory exhaustion issues caused by GCs are completely bypassed.

Re:Proposed New Go GC: Transaction-Oriented Collector by pjmlp on Friday June 24, 2016 @02:42PM (#11972324)
The problem with RC as algorithm is that it increases locking on shared data structures, thus cache contention, and you still have "stop the world" when destroying a complex data structure causes a cascade of deletions.

There was a Swift talk exactly about struct vs reference types and making use of COW data structures to reduce ARC impact.

Re:Proposed New Go GC: Transaction-Oriented Collector by masklinn on Friday June 24, 2016 @03:44PM (#11972840)
> Does anyone feel confident that a 'good enough for everyone' GC will ever be produced?

Probably not, GC is always full of tradeoffs. That's why the JVM has a bunch of tuneable GCs, and there are third-party JVMs with their own strategies and GC tradeoffs (e.g. Azul).