Skip to content

Memoize fix applications in Mu

Yann Regis-Gianas requested to merge yrg@optimize-mu into master

Each time a recursive value of encoding Mu fix is decoded, fix is applied. That's an important source of inefficiency, especially when we encode algebraic datatypes. Indeed, if the encoding is built using mu (fun self -> union [case 1 .. self ..; ...; case N .. self ..] the check_cases function is called each time we encode and decode a recursive value!

The following MR introduces a basic in-place memorization of fix inside Mu.

Edited by Yann Regis-Gianas

Merge request reports