Get the latest tech news

The Curious Case of Beam CPU Usage (2019)


While benchmarking Go vs Elixir vs Node, we discovered that Elixir (running on the BEAM virtual machine) had much higher CPU usage than Go, and yet its responsiveness remained excellent. Some of our readers suggested that busy waiting might be responsible for this behavior.

The standard way of handling this is to let the operating system kernel manage synchronization in such a way that, while waiting for an event, other threads get the opportunity to run. In addition, when running BEAM in the cloud on burstable performance instances, busy waiting may result in spending unnecessary CPU credits. When running BEAM on an OS kernel shared with other software, it makes sense to turn off busy waiting, to avoid stealing time from non-BEAM processes.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of curious case

curious case

Photo of beam cpu usage

beam cpu usage

Related news:

News photo

The Curious Case of Quentell

News photo

A curious case of O(N^2) behavior which should be O(N) (2023)

News photo

The curious case of Nebius, the publicly traded AI infrastructure ‘startup’