Skip to content

Improve boot speed - #16014

Closed
wojtekmach wants to merge 3 commits into
elixir-lang:mainfrom
wojtekmach:wm-fast-boot
Closed

wojtekmach wants to merge 3 commits into
elixir-lang:mainfrom
wojtekmach:wm-fast-boot

Conversation

@wojtekmach

Copy link
Copy Markdown
Member

See individual commit descriptions.

OTP master:

    $ hyperfine -N -w 10 -r 200 \
      -n "main" "/usr/bin/env PATH=$HOME/src/elixir-ex40-base/bin:$HOME/src/otp-ex40-master/bin:$PATH elixir -e 'IO.puts :hello'" \
      -n "main + wm-ex40-script" "/usr/bin/env PATH=$HOME/src/elixir-ex40-script/bin:$HOME/src/otp-ex40-master/bin:$PATH elixir -e 'IO.puts :hello'"
    Benchmark 1: main (200 runs)
                    mean     ±       σ          min     …     max
      Wall Time     81.4 ms  ±     1.5 ms      78.3 ms  …    85.6 ms
      Memory        79.8 MiB ±     0.4 MiB     79.0 MiB …    81.0 MiB

    Benchmark 2: main + wm-ex40-script (200 runs)
                    mean     ±       σ          min     …     max
      Wall Time     76.6 ms  ±     1.5 ms      74.0 ms  …    81.3 ms            -5.9%
      Memory        79.9 MiB ±     0.4 MiB     79.0 MiB …    80.9 MiB           +0.1%

OTP master + erlang/otp#11814:

    $ hyperfine -N -w 10 -r 200 \
      -n "main" "/usr/bin/env PATH=$HOME/src/elixir-ex40-base/bin:$HOME/src/otp-ex40-base/bin:$PATH elixir -e 'IO.puts :hello'" \
      -n "main + wm-ex40-script" "/usr/bin/env PATH=$HOME/src/elixir-ex40-script/bin:$HOME/src/otp-ex40-base/bin:$PATH elixir -e 'IO.puts :hello'"
    Benchmark 1: main (200 runs)
                    mean     ±       σ          min     …     max
      Wall Time     69.6 ms  ±     1.6 ms      66.6 ms  …    77.9 ms
      Memory        79.8 MiB ±     0.4 MiB     78.8 MiB …    81.2 MiB

    Benchmark 2: main + wm-ex40-script (200 runs)
                    mean     ±       σ          min     …     max
      Wall Time     64.9 ms  ±     1.4 ms      62.0 ms  …    68.7 ms            -6.6%
      Memory        79.9 MiB ±     0.4 MiB     79.0 MiB …    80.9 MiB            0.0%
OTP master:

    $ hyperfine -N -w 10 -r 200 \
      -n "main" "/usr/bin/env PATH=$HOME/src/elixir-ex40-base/bin:$HOME/src/otp-ex40-master/bin:$PATH elixir -e 'IO.puts :hello'" \
      -n "main + wm-ex40-preload" "/usr/bin/env PATH=$HOME/src/elixir-ex40-preload/bin:$HOME/src/otp-ex40-master/bin:$PATH elixir -e 'IO.puts :hello'"
    Benchmark 1: main (200 runs)
                    mean     ±       σ          min     …     max
      Wall Time     81.3 ms  ±     1.6 ms      78.0 ms  …    87.6 ms
      Memory        79.8 MiB ±     0.4 MiB     78.9 MiB …    81.0 MiB

    Benchmark 2: main + wm-ex40-preload (200 runs)
                    mean     ±       σ          min     …     max
      Wall Time     77.5 ms  ±     3.0 ms      70.4 ms  …    98.8 ms            -4.7%
      Memory        81.3 MiB ±     0.4 MiB     80.5 MiB …    82.5 MiB           +1.9%

OTP master + erlang/otp#11814:

    $ hyperfine -N -w 10 -r 200 \
      -n "main" "/usr/bin/env PATH=$HOME/src/elixir-ex40-base/bin:$HOME/src/otp-ex40-base/bin:$PATH elixir -e 'IO.puts :hello'" \
      -n "main + wm-ex40-preload" "/usr/bin/env PATH=$HOME/src/elixir-ex40-preload/bin:$HOME/src/otp-ex40-base/bin:$PATH elixir -e 'IO.puts :hello'"
    Benchmark 1: main (200 runs)
                    mean     ±       σ          min     …     max
      Wall Time     69.3 ms  ±     1.7 ms      66.4 ms  …    74.3 ms
      Memory        79.8 MiB ±     0.4 MiB     78.9 MiB …    81.2 MiB

    Benchmark 2: main + wm-ex40-preload (200 runs)
                    mean     ±       σ          min     …     max
      Wall Time     66.5 ms  ±     3.4 ms      60.2 ms  …    91.0 ms            -4.0%
      Memory        81.2 MiB ±     0.4 MiB     80.0 MiB …    82.5 MiB           +1.8%
The previous commit loads the CLI modules before the elixir application
starts. This changes the atom order. Then Module.Types.ExprTest fails,
because it expects List before String.
@josevalim

Copy link
Copy Markdown
Member

Merged manually, thank you!

@josevalim josevalim closed this Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants