Arity Raising in Effekt
Compiler optimizations improve runtime performance without requiring changes to source code. This thesis implements arity raising for record types in the Effekt compiler, an optimization that replaces record arguments with their individual fields, eliminating unnecessary memory allocations at function call sites. The transformation handles flat records, arbitrarily nested records, and higher-order functions by inserting adapter lambdas where needed. Benchmarks on the LLVM backend show impressive speedups for programs that frequently recreate records, while programs that only reuse records see little to no benefit. The main limitation is a slowdown when functions return records unchanged, caused by unconditional record reconstruction that the optimizer fails to eliminate. Extending the optimizer to push record reconstructions as deep as possible would likely resolve this.