Exploring Perceus For OCaml

A Direct Comparison between Precise Reference Counting and Generational Garbage Collection. Presented at the Higher-order, Typed, Inferred, Strict: ML Family Workshop 2023. Sep 8, 2023. ELTON PINTO, Georgia Institute of Technology, USA DAAN LEIJEN, Microsoft Research, USA

The Perceus algorithm [Reinking, Xie et al. 2021] is a precise and garbage-free reference counting scheme which shows good performance in practice. However, the algorithm has only been compared against garbage-collection across different systems and languages. There is no direct comparison between Perceus and a garbage collector within the same system. In this work, we take a step towards this goal. We have implemented a prototype of Perceus for OCaml 4.14.0 (which subsumes the standard garbage collector [Doligez and Leroy 1993]). Now we can directly compare the performance of programs compiled with the exact same compiler, where we only switch the backend: either using the standard generational collector, or using Perceus compilation with a reference counted runtime system. The initial performance results look quite promising, motivating futher exploration.