Closed lukaszcz closed 2 days ago
I think the conclusion from this is that we should never use automatically generated Uniplate instances to traverse the whole program tree or anything sizeable. The performance penalty is ridiculous -- we were traversing only twice to get all lets (once before and once after type checking) and this alone took above 14% of total running time.
letFunctionDefs
altogether, in favour of handwritten traversal accumulating let definitions (implemented via the newHasLetDefs
typeclass).Benchmark results
Using Uniplate:
Using
HasLetDefs
:So it's roughly 1.1s vs. 1.4s, faster by 0.2s. About 14% improvement.
The benchmark file just imports the standard library:
Both
juvix
binaries were compiled with optimizations, usingjust install
.