Manual eta expansion leads to orders of magnitude less allocations
While working on deterministic free variable computation I run into some performance issues. I narrowed it down to code that when eta expanded performed less allocations.
I ended up writing a benchmark and for large examples the eta expanded versions performs orders of magnitude less allocations.
The results of my test:
EtaExpanded test3 50,450,112 bytes allocated in the heap real 0.89 EtaReduced test3 3,661,740,240 bytes allocated in the heap real 3.66
The whole source is here: https://github.com/niteria/deterministic-fvs, I'm also attaching the two interesting implementations.
I experimented with it a little and GHC eta-expanded when I didn't have mutually recursive bindings.