News for hackers. Stuff that matters.
Re:Crystal: Fast as C, Slick as Ruby by bjourne on Thursday August 04, 2016 @01:20PM (#12227064)
For most GC algorithms (but not ref-counting), the time complexity is O(N) where N is the number of surviving objects (or it could be the number of surviving edges/references, I forgot!). For manual/deterministic/eager memory management, the complexity is O(N) where N is the number of allocated/freed objects.

So if the number of survivors << the number of allocated objects, which it always is in many functional languages, then GC can be faster than manual memory management. Especially if you use a copying GC algorithm which makes allocation extremely cheap.

There are no comments on this comment yet.