20,741
edits
| Line 66: | Line 66: | ||
== incremental GC == | == incremental GC == | ||
an incremental garbage collector can help improve performance by spreading out the work of garbage collection over multiple small increments rather than performing it all at once. This can help prevent stuttering and make the garbage collection process more deterministic. | an incremental garbage collector can help improve performance by spreading out the work of garbage collection over multiple small increments rather than performing it all at once. This can help prevent stuttering and make the garbage collection process more deterministic. | ||
The developer of Nasal, Andy Ross, originally considered implementing an incremental garbage collection scheme in Nasal. The idea was to perform garbage collection normally, but to check timestamps periodically and interrupt the garbage collection process if it exceeded a certain threshold. This would allow the garbage collector to continue its work in the background, rather than blocking the program until it had finished. | |||
However, implementing an incremental garbage collection scheme in Nasal would require additional steps to ensure that all objects are properly collected. For example, it would be necessary to track mutated reference-storing objects in a separate list so that they can be swept again. Additionally, a heuristic would be needed to determine when it is safe to restart the sweep and continue garbage collection. | |||
Overall, implementing an incremental garbage collection scheme in Nasal would be a complex undertaking that would require careful design and implementation. It is not clear whether the benefits of an incremental garbage collection scheme would outweigh the additional complexity and overhead that it would introduce. | |||
== concurrent GC == | == concurrent GC == | ||