summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@dashbit.co>2021-11-26 06:46:50 +0100
committerGitHub <noreply@github.com>2021-11-26 06:46:50 +0100
commitcc877ee16bfcc96afaeb392e683984ae81f847d6 (patch)
treec4b7a688a2ac2fb4eda929be635725eced1393ef
parentf5208a39a3c13ab56516a8d5bea59ddcc3a8c472 (diff)
downloadelixir-cc877ee16bfcc96afaeb392e683984ae81f847d6.tar.gz
Disable ssa and bool passes (#11420)
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.
-rw-r--r--lib/elixir/src/elixir_compiler.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/elixir/src/elixir_compiler.erl b/lib/elixir/src/elixir_compiler.erl
index d479f751c..1e5e15133 100644
--- a/lib/elixir/src/elixir_compiler.erl
+++ b/lib/elixir/src/elixir_compiler.erl
@@ -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)}.