Changes to clause garbage collection

Keri Harris discovered that programs with thousands of dynamic predicates suffered from a significant slow-down due to clause garbage collection. Trying to fix this revealed a deeper design error of mine that could lead to use after free crashes. The system was always vulnerable to this for reloading static code (recompiling), but as this doesn’t happen too frequently it went by mostly unnoticed.

Keri pushed some fixes that should remedy this. Nor me, Keri or Paulo managed to break it. Especially if you have programs that heavily depend on assert/retract, please test the current git version and report any regression. According to our (quick) measurements the performance affect ranges between unmeasurable to an about 3 times speedup on extreme programs with tens of thousands dynamic predicates.

2 Likes