You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calls are two steps: there's an Elixir wrapper for the natural experience and autocomplete, and there's the call instruction.
Tree shaking aka dead code elimination is ideal for keeping the resulting modules down. If we use a number formatter but only format unsigned 32-bit ints we should not include the code for formatting floats.
Initially I thought this would require walking through the AST and detecting every call and then removing the functions we noticed were never called.
But there's an even easier way with our two layers. The Elixir call is a real call. We can have an ets table at compile time and increment a counter whenever a function is called, passing the function name as a key. So there's no need to do another pass: we have the Elixir runtime pass already.
We then loop through every function at assembly time and omit the ones that aren't in the ets table. Possibly the counters could be used for some debug output or optimisation (e.g. inlining?)
The text was updated successfully, but these errors were encountered:
Calls are two steps: there's an Elixir wrapper for the natural experience and autocomplete, and there's the call instruction.
Tree shaking aka dead code elimination is ideal for keeping the resulting modules down. If we use a number formatter but only format unsigned 32-bit ints we should not include the code for formatting floats.
Initially I thought this would require walking through the AST and detecting every call and then removing the functions we noticed were never called.
But there's an even easier way with our two layers. The Elixir call is a real call. We can have an ets table at compile time and increment a counter whenever a function is called, passing the function name as a key. So there's no need to do another pass: we have the Elixir runtime pass already.
We then loop through every function at assembly time and omit the ones that aren't in the ets table. Possibly the counters could be used for some debug output or optimisation (e.g. inlining?)
The text was updated successfully, but these errors were encountered: