4 ms·
I'm a little surprised at where Erlang features in the list. I've never used it personally, but have heard so much about it being an amazing, performant languag
by osrec 8y ago
I'm a little surprised at where Erlang features in the list. I've never used it personally, but have heard so much about it being an amazing, performant language. I wonder why it's so time/energy/memory inefficient for the algorithms used in this exercise.
- erik_seaberg 8y agoIs this the cost of restarting processes due to "let it crash" error handling?
- osrec 8y agoNo idea, but I doubt it if they're testing with well defined algorithms. I can't imagine the tests throwing lots of errors.
- chris_st 8y agoErlang's use case is handling lots of connections simultaneously, and messaging between processes. These benchmarks are all single-threaded, pure computation. Erlang is pretty slow at that (alas).
- elcritch 8y agoI’d certainly put Erlang (and Elixir) in the class of scripting languages. In that category it beats out most of the other classic scripting languages like Python, Ruby, Perl, and Lua at execution speed and energy usage, aside from JavaScript and oddly PHP. For being a mostly pure functional language it performs pretty well in that category. To the parent comment’s question, the reputation for solid performance likely comes from Ruby/Python developers. When dealing with web server applications it really shines due to how it handles concurrency. Also NIFs are really easy to write, especially in Rust.
- 4thaccount 8y agoIt's built for massively distributed systems and is efficient at that I believe. It's not really designed to be a replacement for numeric languages like C/C++/Fortran/Ada...etc. It's a high level language, so what you gain in user development efficiency, you lose in performance. Someone knowledgeable in Erlang could confirm though as I'm being general.
- PinkMilkshake 8y agoBEAM has a 'busy wait' feature. Schedulers with no jobs to do will remain active so they can respond to new jobs faster. You can turn this down so that the schedulers go to sleep quicker, reducing CPU usage. From http://erlang.org/doc/man/erl.html http://erlang.org/doc/man/erl.html: +sbwt none|very_short|short|medium|long|very_long Sets scheduler busy wait threshold. Defaults to medium. The threshold determines how long schedulers are to busy wait when running out of work before going to sleep.
- osrec 8y agoInteresting. Have you ever used Erlang in production? How did you find it?
- PinkMilkshake 8y agoNot really no. The closest thing to production I've used it was as a one-liner web-server to serve some images.
- tannhaeuser 8y agoIt's pretty obvious if you're running RabbitMQ which ranks highly in the output of `top` even if no messages are being processed.