News for hackers. Stuff that matters.
Re:Copy-on-write friendly Python garbage collection by ComputerGuru on Monday January 01, 2018 @03:08PM (#16047767)
Not directly pertaining to the article but in relation to the comments here, I feel it’s necesary to remind that the real problem with GC isn’t average processing time/max simultaneous requests but rather the large standard deviation resulting from GC pauses (and not to mention the poor cache friendliness, memory evictions, and more as a result - but those are taken into account in the the average run times so we can ignore them in this context).

As a related metric, sometimes it’s not your average response times and scale that matters but how much headroom you’ve got for a sudden influx of traffic. If memory/pagefile thrashing and hard faults bring your system screeching to a halt, you won’t be happy no matter your scale when you can’t benefit from the eyeballs and pageclicks coming your way.

Re:Copy-on-write friendly Python garbage collection by rbehrends on Monday January 01, 2018 @08:23PM (#16049131)
Eh, incremental garbage collection is technology that has been around since the 1980s/1990s. For purely sequential systems (which is what we're talking about here), it is pretty easy to make GC soft real-time [1]. We are talking about maximum pause times well below just the network latency between the client and the web server.

Cache friendliness is a double-edged sword. There are plenty of use cases where a GC can be more cache-friendly than manual memory management, in particular if you have a generational GC with a bump allocator.

[1] What makes life (considerably) harder is when you have multiple threads sharing a heap, but that's not at issue here.

Re:Copy-on-write friendly Python garbage collection by CoolGuySteve on Tuesday January 02, 2018 @12:13AM (#16050023)
If it’s pretty easy, where are all these soft real-time garbage collectors?
Re:Copy-on-write friendly Python garbage collection by rbehrends on Tuesday January 02, 2018 @01:41AM (#16050323)
Note that I was specifically talking about the sequential case, not multi-threaded languages.

OCaml has had one since the 1990s [1]; it's a fairly standard generational, compacting collector with incremental collection for the old generation. Lua has had an incremental GC since version 5.1 (in 2006); as it's frequently used as a scripting language for video games, it's safe to assume that pause times aren't much of an issue.

The problem is that virtually every language since then has pretty much decided to have all threads use a global shared heap. Once you do that, you run into all kinds of challenges, such as root discovery from thread stacks without stopping the world. That said, there are plenty of languages that have this option, anyway; it's simply more challenging, not impossible.

Languages that are single-threaded maintain thread-local heaps don't have the problem. Python and Ruby (unlike Lua) have issues for historical reasons (they started out with basic reference counting and mark-and-sweep collection, respectively, and then had to maintain backwards compatibility [2]).

Intermediate designs (having both thread-local heaps and shared heaps at the same time) are also possible, but that design space hasn't been explored much.

[1] http://prl.ccs.neu.edu/blog/2016/05/24/measuring-gc-latencie...

[2] I think that in principle one could make the cycle detector in Python incremental (it's basically a form of trial deletion); Ruby eventually got an incremental GC for its major generations in 2.2, but I believe there are still some inherent limitations due to the lack of write barriers in C code.

Re:Copy-on-write friendly Python garbage collection by tychver on Tuesday January 02, 2018 @02:25AM (#16050438)
Running T-Mobile's Erlang powered LTE network.
Re:Copy-on-write friendly Python garbage collection by the8472 on Tuesday January 02, 2018 @12:22AM (#16050053)
Golang, Azul's C4, Shenandoah, Metronome, ...?
Re:Copy-on-write friendly Python garbage collection by jacobolus on Monday January 01, 2018 @05:57PM (#16048521)
Moreover, in a distributed systems context where many machines are involved in each task some 'rare' issues can end up happening a large proportion of tasks, and solitary problems can cascade and cause positive feedback loops that bring your whole system down.