[erlang-bugs] R16B takes long to compile a simple module

Björn Gustavsson <>
Wed Mar 13 15:29:43 CET 2013


Thanks for reporting this issue!

I introduced a new optimization in R16
and failed to optimize it. I will fix it
in the R16B01 release.

/Bjorn


On Tue, Mar 12, 2013 at 4:39 PM, Magnus Müller <
> wrote:

> The following small module takes ~10s to compile with R16B (erl +V
> below). The code is distilled from indent/erlang_indent.erl in vimerl
> [1]. Diagnostics are fast (a small syntax error somewhere crashes the
> compilation immediately). The same module compiles quickly (<1s) with R15B.
>
> -------------------------------------------------
> -module(erlang_indent).
>
> -export([p/2]).
>
> -define(IS(T, C), (element(1, T) == C)).
>
> -record(state, {stack = []}).
>
> p(T1, #state{stack = [T2 | _]}) when ?IS(T2, a), ?IS(T1, b), ?IS(T1, c)
> -> ok; p(T, _) when ?IS(T, a1); ?IS(T, b1); ?IS(T, c1) -> ok;
> p(T, _) when ?IS(T, a2); ?IS(T, b2); ?IS(T, c2) -> ok;
> p(T, _) when ?IS(T, a) -> ok;
> p(T, _) when ?IS(T, a), (?IS(T, b) and ?IS(T, c)) -> ok;
> p(_, T) when ?IS(T, a) -> ok;
> p(_, T) when ?IS(T, b) -> ok;
> p(T, _) when ?IS(T, a) -> ok.
> -------------------------------------------------
>
> $ erl +V
> Erlang (SMP,ASYNC_THREADS,HIPE) (BEAM) emulator version 5.10.1
>
>
> The original file[2] in vimerl takes even longer to compile. Note that
> that [2] is actually an escript, but the error persists when
> it is converted to a module.
>
>
> [1] https://github.com/jimenezrick/vimerl
> [2]
> https://raw.github.com/jimenezrick/vimerl/master/indent/erlang_indent.erl
> _______________________________________________
> erlang-bugs mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-bugs
>



-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20130313/69152c2c/attachment.html>


More information about the erlang-bugs mailing list