Hacker News new | ask | show | jobs
by Communitivity 1766 days ago
For me, Elixir with Rust NIFs seems like a match made in heaven.

The BEAM VM is amazing at many things but it is still a VM and while the BeamAsm Just In Time compiler added in 2020 can offer performance improvement gains of 130%, there are areas where the BEAM still won't outperform native code.

Erlang excels at network programming and binary data processing. Computation intensive math and heavy string processing are both good NIF use cases.

An article on string performance [1],pre-JIT, describes initial Elixir benchmark of 140s vs C's 3.74s. They managed to make a number of tradeoffs and get the Elixir benchmark improved to 13s. Part of how they did that was to not use unicode (IO.binstream instead of IO.stream), that alone gained them ~4s.

[1] https://blog.jola.dev/elixir-string-processing-optimization