4 ms·
True. That bullet was more of my opinion of disliking the memory usage the JVM uses as well as my personal preference of VM. BEAM has many great advantages suc
by alexgaribay 10y ago
True. That bullet was more of my opinion of disliking the memory usage the JVM uses as well as my personal preference of VM.
BEAM has many great advantages such as fault tolerance and multi-node distribution built in. This allows concurrency to be a first-class citizen for applications running on the BEAM. I'm not saying that concurrency can't be done on the JVM, but that I've found it to be much simpler using BEAM. On the other hand, the JVM excels at computational work compared to the BEAM. Both VMs have their place and can be better at different types of problems comparatively.
- andy_ppp 10y agoYou can also compile Elixir and Erlang to native code if you want it to run computational stuff faster...
- ngrilly 10y ago> You can also compile Elixir and Erlang to native code How? Can you provide a link about this?
- andy_ppp 10y agoAdd this at the top of your module (in Elixir): @compile [:native, {:hipe, [:verbose, :o3]}] :-o
- ngrilly 10y agoHi forgot about HiPE :-) But it doesn't produce a native binary, does it?
- andy_ppp 10y agoWhere did I claim it did?
- ngrilly 10y agoNowhere :-) I read too fast and mistakenly assumed native code = native executable binary. Is using HiPE a standard practice in the Erlang/Elixir community? What is the quantitative performance gain?
- lucidstack 10y agoThis comment from Reddit sums it up pretty well: https://www.reddit.com/r/elixir/comments/3gd1n3/what_are_the_downsides_to_compiling_elixir_code/ctx45xh https://www.reddit.com/r/elixir/comments/3gd1n3/what_are_the... I just discovered about HiPE as well, and I just gave it a try with a simple fibonacci module. Running fibonacci(40) went from 3.9s BEAM to 0.7s HiPE. I know it's a silly test, but it's pretty sweet to witness such a massive difference out of the box. :)
- ngrilly 10y agoThanks for the link. I won't say testing HiPE with fibonacci is silly because this is exactly the kind of numerical computation where we expect HiPE to be useful: it looks like it is :-)
- i336_ 10y ago> [T]he JVM excels at computational work compared to the BEAM. What sorts of scales are you talking about when you refer to "computational work"? Also, was/were the comparison(s) you're referring to being done using native code?