Skip to content

Commit

Permalink
Disable ssa and bool passes (#11420)
Browse files Browse the repository at this point in the history
Module bodies, especially in tests, tend to be
long, which affects the performance of passes
such as beam_ssa_opt and beam_bool. This commit
disables those passes during module definition.
As an example, this makes loading Elixir's test
suite 7-8% faster.
  • Loading branch information
josevalim authored Nov 26, 2021
1 parent f5208a3 commit cc877ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/elixir/src/elixir_compiler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ spawned_compile(ExExprs, #{line := Line, file := File} = E) ->
Fun = code_fun(?key(E, module)),
Forms = code_mod(Fun, ErlExprs, Line, File, Module, Vars),

{Module, Binary} = elixir_erl_compiler:noenv_forms(Forms, File, [nowarn_nomatch]),
{Module, Binary} = elixir_erl_compiler:noenv_forms(Forms, File, [nowarn_nomatch, no_bool_opt, no_ssa_opt]),
code:load_binary(Module, "", Binary),
{Module, Fun, is_purgeable(Module, Binary)}.

Expand Down

0 comments on commit cc877ee

Please sign in to comment.