Skip to content

Allocating StablePtrs leads to GC slowdown even after they're freed

If we allocate and then free a lot of StablePtrs the GC performance will be degrated for the rest of the execution.

I have attached a program that performs a GC-heavy task (foldr'ing a long list of Ints) before and after allocating and then freeing a million StablePtrs. After the StablePtrs are freed the task takes more than twice as long.

The reason for this is that stable_ptr_table in Stable.c is never resized, and is looped over for every GC pause.

Edited by bitonic
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information