Skip to content

Consider the immix GC #5271

@pnloyd

Description

@pnloyd

I came across a GC called immix that is very new and wanted to bring it to the attention of the Crystal community. immix was written by contributors of the scala-native project, which aims to compile Scala to native code via llvm as a backend, like Crystal. Also like Crystal, they originally opted to use the boehm GC during their initial implementation, but made plans to explore other options.

Why should the Crystal community pay attention to this GC? Look at these benchmarks.
image

It appears as though for smallish heap sizes the immix algorithm comes very close to the performance of not having a GC running at all. Which seems amazing to me (although I don't know much about the subject).

The scala-native devs say immix is ahead of the curve performance wise in comparison to the majority of GC's which are based on research from the 90's and early 2000's (immix was 2008). They still are using boehm by default but plan to switch to immix soon as it gains some maturity.

You can see the source for immix here:
https://github.com/scala-native/scala-native/tree/master/nativelib/src/main/resources/gc/immix

And in these two files you can see that they define an identical interface for both boehm and immix, that is not to far off from the APIs Crystal uses from boehm.
https://github.com/scala-native/scala-native/blob/master/nativelib/src/main/resources/gc/immix/ImmixGC.c
https://github.com/scala-native/scala-native/blob/master/nativelib/src/main/resources/gc/boehm/gc.c

Here's the point in the relevant talk where the scala-native dev talks about immix and discuses some it's performance characteristics.
https://youtu.be/JZCeQi_xLok?t=14m1s

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions