# Erlang vs Golang - comparing the fairness and real-time performance of schedulers in Erlang and Go

**URL:** <https://erlangforums.com/t/erlang-vs-golang-comparing-the-fairness-and-real-time-performance-of-schedulers-in-erlang-and-go/5017>\
**Category:** Chat / Discussions\
**Tags:** erlang, golang\
**Created:** [August 26, 2025, 3:18pm UTC](https://erlangforums.com/t/erlang-vs-golang-comparing-the-fairness-and-real-time-performance-of-schedulers-in-erlang-and-go/5017 "2025-08-26T15:18:21Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![lichuan](https://erlangforums.com/user_avatar/erlangforums.com/lichuan/32/2980_2.png) [@lichuan](https://erlangforums.com/u/lichuan)\
**Post date:** [August 26, 2025, 3:18pm UTC](https://erlangforums.com/t/erlang-vs-golang-comparing-the-fairness-and-real-time-performance-of-schedulers-in-erlang-and-go/5017/1 "2025-08-26T15:18:21Z")

</div>

Hi,

I’ve created a new repository on GitHub to compare the fairness and real-time performance of schedulers in Erlang and Go. Feel free to check it out!

> This repository contains a comparative analysis of the scheduling fairness and real-time performance between Golang and Erlang. The tests demonstrate that **Golang’s goroutine scheduler performs poorly** - it’s crude, unfair, and lacks good real-time characteristics. In contrast, Erlang’s scheduler proves significantly superior in both fairness and real-time performance!

> **[GitHub - lichuan/erlang-vs-golang: Scheduler Fairness and Real-Time Performance:...](https://github.com/lichuan/erlang-vs-golang)**
>
> Scheduler Fairness and Real-Time Performance: Golang vs Erlang

---

<div class="post-metadata">

**Author:** ![vkatsuba](https://erlangforums.com/user_avatar/erlangforums.com/vkatsuba/32/314_2.png) [@vkatsuba](https://erlangforums.com/u/vkatsuba)\
**Post date:** [August 26, 2025, 4:57pm UTC](https://erlangforums.com/t/erlang-vs-golang-comparing-the-fairness-and-real-time-performance-of-schedulers-in-erlang-and-go/5017/2 "2025-08-26T16:57:13Z")

</div>

Very nice! Thanks for sharing!

---

<div class="post-metadata">

**Author:** ![lichuan](https://erlangforums.com/user_avatar/erlangforums.com/lichuan/32/2980_2.png) [@lichuan](https://erlangforums.com/u/lichuan)\
**Post date:** [August 27, 2025, 3:02pm UTC](https://erlangforums.com/t/erlang-vs-golang-comparing-the-fairness-and-real-time-performance-of-schedulers-in-erlang-and-go/5017/3 "2025-08-27T15:02:43Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![ieQu1](https://erlangforums.com/user_avatar/erlangforums.com/iequ1/32/2633_2.png) [@ieQu1](https://erlangforums.com/u/ieQu1)\
**Post date:** [August 27, 2025, 7:31pm UTC](https://erlangforums.com/t/erlang-vs-golang-comparing-the-fairness-and-real-time-performance-of-schedulers-in-erlang-and-go/5017/4 "2025-08-27T19:31:56Z")

</div>

Fibonacci implementation in Go uses recursion, one could probably argue that this is not idiomatic Go.

---

<div class="post-metadata">

**Author:** ![vkatsuba](https://erlangforums.com/user_avatar/erlangforums.com/vkatsuba/32/314_2.png) [@vkatsuba](https://erlangforums.com/u/vkatsuba)\
**Post date:** [August 27, 2025, 7:39pm UTC](https://erlangforums.com/t/erlang-vs-golang-comparing-the-fairness-and-real-time-performance-of-schedulers-in-erlang-and-go/5017/5 "2025-08-27T19:39:50Z")

</div>

I suppose it also can be good idea to create comparing of Rust and Erlang with similar approach.

---

<div class="post-metadata">

**Author:** ![lichuan](https://erlangforums.com/user_avatar/erlangforums.com/lichuan/32/2980_2.png) [@lichuan](https://erlangforums.com/u/lichuan)\
**Post date:** [August 28, 2025, 1:51am UTC](https://erlangforums.com/t/erlang-vs-golang-comparing-the-fairness-and-real-time-performance-of-schedulers-in-erlang-and-go/5017/6 "2025-08-28T01:51:25Z")

</div>

In Go, whether Fibonacci is implemented recursively or not, as long as the code of function work1 and function work2 is the same, work1 and work2 should be treated fairly, ensuring that their execution counts remain close.

---

<div class="post-metadata">

**Author:** ![rvirding](https://erlangforums.com/user_avatar/erlangforums.com/rvirding/32/178_2.png) [@rvirding](https://erlangforums.com/u/rvirding)\
**Post date:** [August 28, 2025, 1:05pm UTC](https://erlangforums.com/t/erlang-vs-golang-comparing-the-fairness-and-real-time-performance-of-schedulers-in-erlang-and-go/5017/7 "2025-08-28T13:05:31Z")

</div>

Why should this make a difference. You would expect the real-time handling to be able however things are done in Golang code. Otherwise it is a very “unsafe” handling if I am forced to write my code in a specific way for it to work.

---

<div class="post-metadata">

**Author:** ![lichuan](https://erlangforums.com/user_avatar/erlangforums.com/lichuan/32/2980_2.png) [@lichuan](https://erlangforums.com/u/lichuan)\
**Post date:** [August 29, 2025, 12:20am UTC](https://erlangforums.com/t/erlang-vs-golang-comparing-the-fairness-and-real-time-performance-of-schedulers-in-erlang-and-go/5017/8 "2025-08-29T00:20:12Z")

</div>

Yes, you are right. Golang’s scheduler should strive to treat each goroutine fairly and allocate time slices equitably. However, in reality, its scheduler cannot achieve complete fairness and real-time performance, which is why the execution counts of work1 and work2 have ended up differing.

---

<div class="post-metadata">

**Author:** ![ieQu1](https://erlangforums.com/user_avatar/erlangforums.com/iequ1/32/2633_2.png) [@ieQu1](https://erlangforums.com/u/ieQu1)\
**Post date:** [August 29, 2025, 9:50am UTC](https://erlangforums.com/t/erlang-vs-golang-comparing-the-fairness-and-real-time-performance-of-schedulers-in-erlang-and-go/5017/9 "2025-08-29T09:50:25Z")

</div>

I don’t know much about Go runtime, but Concurrent Haskell runtime (GHC), for example, [yields on heap allocation](https://downloads.haskell.org/ghc/9.12.2/docs/users_guide/using-concurrent.html#using-concurrent-haskell). That illustrates how minor benchmark implementation details, like whether to use a loop or recursion, could be relevant for scheduler fairness comparison.

But from non-technical perspective, if you want to make a convincing pro-Erlang argument to Go developers, it’s worth comparing idiomatic code vs. idiomatic code to show the superiority of BEAM scheduler. Otherwise it’ll be easy to dismiss.

---

<div class="post-metadata">

**Author:** ![lichuan](https://erlangforums.com/user_avatar/erlangforums.com/lichuan/32/2980_2.png) [@lichuan](https://erlangforums.com/u/lichuan)\
**Post date:** [August 29, 2025, 10:27am UTC](https://erlangforums.com/t/erlang-vs-golang-comparing-the-fairness-and-real-time-performance-of-schedulers-in-erlang-and-go/5017/10 "2025-08-29T10:27:16Z")

</div>

Although it is not a comprehensive comparison between the schedulers of Golang and Erlang, in this test code, the work1 and work2 functions include not only recursive calls to fib, but also some CPU intensive calculations such as sha256. So at least in this use case, it can still demonstrate the superiority of the Erlang scheduler. By the way, testing should not consider too many so-called idioms. As long as the compilation is successful, it can run, the syntax and semantics are legal, and there are no crashes, then this test case should be recognized.

Moreover, this test code does not compare the absolute difference in execution times between Golang and Erlang, but compares the execution times of work1 and work2 within the same language. Therefore, it can logically prove the fairness and real-time performance of the schedulers of each language.
