aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src
diff options
context:
space:
mode:
authorMichał Muskała <[email protected]>2018-08-04 23:00:55 +0200
committerMichał Muskała <[email protected]>2018-08-07 13:32:22 +0200
commitc2073933a430434351ece355ba04d37fdad693ef (patch)
tree1f2fe7c76b722a3f0e391d647382ec60a1bb1c29 /lib/compiler/src
parentfa6f32fa647a02e1735fca868b589c1f8b2ac5f8 (diff)
downloadotp-c2073933a430434351ece355ba04d37fdad693ef.tar.gz
otp-c2073933a430434351ece355ba04d37fdad693ef.tar.bz2
otp-c2073933a430434351ece355ba04d37fdad693ef.zip
Eliminate double computation of next var
My compiler benchmarks on modules with huge functions, show the next_free_variable_name call to be expensive. It turns out one of the 3 calls to the function was completely ignored.
Diffstat (limited to 'lib/compiler/src')
-rw-r--r--lib/compiler/src/sys_core_fold.erl7
1 files changed, 0 insertions, 7 deletions
diff --git a/lib/compiler/src/sys_core_fold.erl b/lib/compiler/src/sys_core_fold.erl
index ceb7d56221..617411ed56 100644
--- a/lib/compiler/src/sys_core_fold.erl
+++ b/lib/compiler/src/sys_core_fold.erl
@@ -115,13 +115,6 @@ module(#c_module{defs=Ds0}=Mod, Opts) ->
{ok,Mod#c_module{defs=Ds1},get_warnings()}.
function_1({#c_var{name={F,Arity}}=Name,B0}) ->
- %% Find a suitable starting value for the variable counter. Note
- %% that this pass assumes that new_var_name/1 returns a variable
- %% name distinct from any variable used in the entire body of
- %% the function. We use integers as variable names to avoid
- %% filling up the atom table when compiling huge functions.
- Count = cerl_trees:next_free_variable_name(B0),
- put(new_var_num, Count),
try
%% Find a suitable starting value for the variable
%% counter. Note that this pass assumes that new_var_name/1