Rustixir
Elixir/Erlang is Faster than Optimized Rust(tokio) in Message Passing
Hi everyone, im working on find best language/framework/system for
high concurrency, high performance and stable performance
after working 3 years in Erlang/Beam i decision to find better than erlang because
I read many where said: Erlang/Beam is slow !!
then I started to learn and working many real-world project with Rust,
then i find ( Tokio )
(from Tokio website: )
Tokio is an asynchronous runtime for the Rust programming language. It provides the building blocks needed for writing network applications. It gives the flexibility to target a wide range of systems, from large servers with dozens of cores to small embedded devices.
after working with it i thought its great because doing message passing with backpressure in channel like golang style
after writing a distributed realtime database in rust ,
I see a unstable performance even with ( heavy optimized ) was not great
I stopped it and done many research about more optimizing and then
writing a very low cost message broker with persistent for our back-end but again i saw unstable performance
then I switch to Elixir because (I heard about JIT) and from before I have experienced with it for a real-world project
I started prototyping 2 scenario message passing,
differenece was huge .
Beam was Winner in both Scenario: ( seq/concurrent client request to server)
- ==> Request call 1000
- ==> Request call 1000000
Scenario 1 Result ( Rust/Tokio : 65,798 ns __ Elixir: 15,385 ns )
Scenario 2 Result ( Rust/Tokio : 4,256,639 ns ___ Elixir: 299,920 ns )
and the end
after many research about distributed real-time database
after compare many case , find
Mnesia is best ever made Distributed real-time database and many developer
if elixir developers be smart, using it in near future for all OLTP real-time application
now our using Mnesia for read-heavy application
under heavy load,
its have many many great features we not found in other db
it is really complete
Most Liked
benwilson512
Be careful with mnesia, it is not necessarily the easiest thing to use in real world scenarios. Its handling of netsplits is pretty iffy, and there are challenges you can run into if you are regularly adding or removing nodes during deployment (eg, rolling deployment).
The BEAM is absolutely awesome at message passing, but any use of mnesia needs to be done very carefully and with serious testing of its edge cases.
cmkarlsson
Here is a message passing thread from the erlang forum. Don’t know if it is related but at least in the ring benchmark rust comes out quite a bit faster.
Rustixir
Thanks again, for giving me a vision of more about the next benchmark.
I will write better benchmark tomorrow
Tomorrow morning everything will be clear 







