Hacker News new | past | comments | ask | show | jobs | submit login

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.



BEAM 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:

  +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.


Interesting. Have you ever used Erlang in production? How did you find it?


It's pretty obvious if you're running RabbitMQ which ranks highly in the output of `top` even if no messages are being processed.


Not really no. The closest thing to production I've used it was as a one-liner web-server to serve some images.


Erlang'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).


I’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.


It'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.


Is this the cost of restarting processes due to "let it crash" error handling?


No idea, but I doubt it if they're testing with well defined algorithms. I can't imagine the tests throwing lots of errors.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: