4 ms·
Inlining pattern matches allows you to eliminate the value being matched on, preventing an allocation. It transforms an allocation into a function call.
by wyager 6y ago
Inlining pattern matches allows you to eliminate the value being matched on, preventing an allocation. It transforms an allocation into a function call.
- wahern 6y ago> Inlining pattern matches allows you to eliminate the value being matched on, preventing an allocation. Where is the return type state stored?
- wyager 6y agoWhat do you mean “return type state”? If you mean the return value, that depends on the semantics/ABI of the language, but if it would result in an allocation, that can be eliminated by another round of inlining. Functional compilers typically have to deal with the tradeoff between code size and compile time (from lots of inlining) and runtime allocation.