gregtour / duck-lang

The Duck Programming Language
http://www.ducklang.org
109 stars 13 forks source link

Improve the garbage collector. #25

Open gregtour opened 9 years ago

gregtour commented 9 years ago

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).