# Notes on Erlang Performance

**URL:** <https://erlangforums.com/t/notes-on-erlang-performance/1727>\
**Category:** Chat / Discussions\
**Tags:** production, performance\
**Created:** [August 7, 2022, 12:18pm UTC](https://erlangforums.com/t/notes-on-erlang-performance/1727 "2022-08-07T12:18:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AstonJ](https://erlangforums.com/user_avatar/erlangforums.com/astonj/32/9_2.png) [@AstonJ](https://erlangforums.com/u/AstonJ)\
**Post date:** [August 7, 2022, 12:18pm UTC](https://erlangforums.com/t/notes-on-erlang-performance/1727/1 "2022-08-07T12:18:05Z")

</div>

Come across any talks, blog posts or forum posts that highlight why Erlang is so performant? If so please feel free to include them in this thread 😃

---

<div class="post-metadata">

**Author:** ![AstonJ](https://erlangforums.com/user_avatar/erlangforums.com/astonj/32/9_2.png) [@AstonJ](https://erlangforums.com/u/AstonJ)\
**Post date:** [August 7, 2022, 12:22pm UTC](https://erlangforums.com/t/notes-on-erlang-performance/1727/2 "2022-08-07T12:22:28Z")

</div>

Quoting Robert from another thread:

> [@Maximum number of parallel processes](https://erlangforums.com/t/maximum-number-of-parallel-processes/1723/7):
>
> One thing to be very much aware of is that the BEAM puts a lot of effort into making sure that processes will not block the system, even if they do a lot of continual work!
> 
> For example after 4000 reductions (function calls) a process is automatically rescheduled and its scheduler will take the next process in its run-queue and execute that. There is never a need to explicity try and make a process yield in some way. Also processes suspend when waiting for messages and are rescheduled when a message arrives or the receive timesout so there is no busy wait.
> 
> Also processes are automatically load-balanced over all the schedulers so no scheduler will sit dormant while the other schedulers are doing a lot of work.
> 
> These are some reasons why it is perfectly reasonable to run systems with hundreds of thousands or even millions of processes. This is why the most important thing when structuring the system is to look at the concurrency the problem and your solution have and from that work with which processes you need and what they should.
> 
> **EDIT:** One of the major requirements we had from the very beginning when developing Erlang was that the system should never block.

:icon_cool:

---

<div class="post-metadata">

**Author:** ![maxlapshin](https://erlangforums.com/user_avatar/erlangforums.com/maxlapshin/32/1593_2.png) [@maxlapshin](https://erlangforums.com/u/maxlapshin)\
**Post date:** [August 8, 2022, 2:29pm UTC](https://erlangforums.com/t/notes-on-erlang-performance/1727/3 "2022-08-08T14:29:43Z")

</div>

1. OTP team (and other core commiters) spends horrible amount of time of very qualified engineers into making BEAM very and very parallel on modern multicore architecture. If you have 16 cores instead of 8, it is very hard to be event 1.7 times faster. Mutexes, cache lines, NUMA access — all this can ruin any performance even if you jump from something like ruby 1.8 to plain C.

2. parallelism allows to keep data separated in small pieces that are much easier to process. All your inefficient O(N!) algorithms can be not so bad, when you work with very small portions of data. It really help.

3. simplicity and strict rules for immutability of data allows to make very easy and extremely efficient things like dropping whole arena/allocation pools, etc.

Java is known to be comparable with C on linear algorithms, but we know for sure that on our task (massive video streaming) our java-based competitor has the same speed (plus-minus).
