[erlang-bugs] Erlang 18.0-rc1 is behaving slower than 17.4 (and 17.5)

Björn Gustavsson bjorn@REDACTED
Wed Apr 8 10:27:18 CEST 2015


Answers inline below.

On Wed, Apr 8, 2015 at 12:44 AM, José Valim
<jose.valim@REDACTED> wrote:
> I have first noticed this issue when compiling Elixir's grammar. Compiling
> yrl -> erl -> beam is about 20% slower in Erlang 18.0-rc1. The results are
> shown below:
>
> https://gist.github.com/josevalim/ab08341512ba875fb4a7

The BEAM compiler might very well have become slower. There
are new optimizations in sys_core_fold thay may cause slowdowns.
For example, sys_core_fold now keeps track of more type
information than in OTP 17.

> To further verify the performance issues, I have decided to run Elixir's
> test suite with 18.0 and 17.4. Elixir test suite defines a lot of modules
> dynamically when loading so that would be a good test. The results are here:
>
> https://gist.github.com/josevalim/895e2365d5ae517b1c8a
>
> It is interesting that the load/compile times are indeed higher in 18.0 but
> the test suite is also taking *longer*. This may imply it is not the
> compiler that is slower but Erlang itself. I have run the test suite of
> other projects in different Erlang versions (same Elixir version though) and
> seen similar slow down. About a 20% slow down on Erlang 18.0-rc1 overall.

Just to be absolutely clear. How is the 20% slow down measured?
Is it based on the total run-time for the test suites (including
compilation times for dynamic modules)?

Before we can reach the conclusion that the run-time system
is slower, we will need measurements on a piece of Erlang
source code that has not changed between OTP versions.

> Unfortunately, I don't have any idea why this is happening. I have asked
> others to compile the same .yrl file and they have seen similar performance
> hit. It is easy to reproduce it. Download the elixir_parser.yrl file:
>
> https://github.com/elixir-lang/elixir/blob/v1.0/lib/elixir/src/elixir_parser.yrl
>
> And run both commands:
>
>     $ time erlc +time elixir_parser.yrl
>     $ time erlc +time elixir_parser.erl
>

I will have look and see if there are any unnecessary slowdowns
in the BEAM compiler in OTP 18.

/Björn


-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB



More information about the erlang-bugs mailing list