The best option is subject to your application design goals... Best application performance and interactivity? Today, manual collection.
Easiest programming model? Precise generational compacting collector... if you can accept the world-stop problem. Compromise? Some combination of manual and ref-counted... as is typical in C++, Obj-C, Rust?, and now Swift. ---- The widespread state-of-the-art are generational precise compacting collectors, typically with three generations. This basically describes the Hotspot and MS.NET GC. The biggest drawback is their world-stop, causing a heapsize proportional all-threads application pause during a full-collection. (I'd ballpark it on the order of 1-2s per GB of heap on 2014 hardware, but I may be off.) The bleeding-edge state-of-the-art is Azul's C4 precise (continuously concurrent compacting collector), implemented in their commercial Azul Zing JVM. It's advantage is essentially-zero application-pause, using an MMU assisted algorithm. Ref-counting systems are still in active use. On some metrics their throughput is lower than GC, and they don't detect dead-cycles, however, they have no world-stop to cause interactivity problems. IMO, Apple has stayed with refcounting to maintain smooth UI interactivity vs GC, including in their new Swift language. Python uses a hybrid refcount/gc system which provides more deterministic finalization of non-cycled objects. Python is so comparatively slow that the refcounting performance is a non-issue, and it's overwhelmingly single-threaded. Pick your poison. There is no magic silver bullet. Boehm is most typically used as a conservative collector, which is not really comparable to precise collectors... However, it has the advantage that it works (for some definition of works) in C/C++ and other non-GC languages.
_______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
