Performance Implications of Immutability
Learn how Elixir’s immutable data structures improve performance by reusing data and optimizing garbage collection across multiple processes, supporting reliable and efficient concurrent programming.
We'll cover the following...
We'll cover the following...
It’s easy to assume that copying data instead of updating the existing data is inefficient. After all, we have to create a new copy of data whenever we update it, and that’s going to leave lots of old values around to be garbage collected. Let’s look at these in detail below.
Copying data
Although common sense might dictate that all this copying of data is inefficient, the reverse ...