Hacker News new | ask | show | jobs
by karl_schlagenfu 2507 days ago
Is there a performance difference between Elixir and Erlang? I assume not since they both run on BEAM but I've never dabbled with Elixir.
3 comments

Between Elixir and Erlang, there's no difference because it's all BEAM bytecode when it runs.

Between arbitrary individual functions you might encounter, there can be differences, but only in the sense that it could happen between Erlang and Erlang if the functions had different implementations or degrees of optimization or optimization choices.

Worth noting for prospective adopters is that you can seamlessly call Erlang functions from Elixir by adding a : prefix, such as :random.uniform(), and there's no weird overhead or surprises involved.

there are might be some minor overhead for Elixir:

- all uppercase elixir atoms / module names adding "Elixir." prefix

- idiomatic Elixir code uses structs (sugar over maps), where Erlang uses records (sugar over tuples)

- some other idiomatic Elixir code has overhead over Erlang, for example access operator []

Elixir compiles down to the same Erlang Abstract Format as Erlang itself, so performance should be the same.