duck-lang
duck-lang copied to clipboard
Improve the garbage collector.
https://github.com/gregtour/duck-lang/blob/master/duck/garbage.c#L6
Currently all of the GC data structures use an unsorted array/list for tracking data. This really makes the garbage collection sweep O(N^2) on top of the performance cost of completing a trace of the entire environment.
Additionally, the current tracing garbage collector is a stop-the-world collector. In the future, using some sort of tri-color graph to interrupt garbage collection could be useful for maintaining realtime performance for applications, when necessary (like interactive graphical applications).