mfilej
Anyone received their new MacBook Pros today?
I think a bunch of us will be interested in hearing how the new M1 Pro/Max compare to the regular M1 when compiling and running Elixir code. If you have experienced any 2 of the 3, please share!
Most Liked
dvic
I have just merged tried the ARM JIT PR (jit: Add support for 64-bit ARM processors by jhogberg · Pull Request #4869 · erlang/otp · GitHub) into the OTP 24.1.3 release, which gives me OTP 24 + JIT on ARM ![]()
You can try it out with the following (using ASDF):
export OTP_GITHUB_URL="https://github.com/qdentity/otp"
asdf install erlang ref:v24.1.3
asdf local erlang ref:v24.1.3
Running the snippet from https://twitter.com/akoutmos/status/1453558037063639040
{time, _} = :timer.tc(fn -> 1..5_000_000 |> Enum.reduce(0, fn number, acc -> acc + number end) end)
System.convert_time_unit(time, :microsecond, :millisecond)
finishes in 1s, which is very nice compared to the 1.7s the AMD Ryzen 9 3950X in the tweet achieved! Someone also ran it with the OTP 25 development branch and achieved the same same result (1s).
Other improvements to mention here: full recompile on a large project:
37 seconds (Macbook Pro 2017 best i7)
vs
23 seconds (Macbook Pro M1 16 inch 10-core)
Partial recompile on same project (recompiling 42 files):
17 seconds (Macbook Pro 2017 best i7)
vs
5 seconds (Macbook Pro M1 16 inch 10-core)
Overall, very nice speed-ups ![]()
joseph-lozano
For anyone that comes by later, you can dramatically speed up compilation times by either:
- Using the Homebrew version of Erlang
- Using the
KERL_CONFIGURE_OPTIONSfrom the Homebrew formula.
I used:
export KERL_CONFIGURE_OPTIONS="
--disable-debug \
--disable-silent-rules \
--enable-dynamic-ssl-lib \
--enable-hipe \
--enable-shared-zlib \
--enable-smp-support \
--enable-threads \
--enable-wx \
--with-ssl=$(brew --prefix openssl@1.1) \
--without-javac
--enable-darwin-64bit \
--enable-kernel-poll \
--with-dynamic-trace=dtrace \
"
my thinking is that --enable-darwin-64bit is doing the heavy lifting
joseph-lozano
That same compile that took 10 minutes now takes about 1:30, so about 2x faster than the macbook air.
Popular in Discussions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









