Search⌘ K

Agents

Explore how to improve Fibonacci sequence calculations in Elixir by using Agents. Understand how Agents maintain state within processes to cache intermediate results, making your code more efficient while working with concurrent programming concepts and persistent state management.

We'll cover the following...

Our Fibonacci code is really inefficient. To calculate fib(5), we calculate this:

Make Fibonacci code efficient

Look at all that duplication. If only we could cache the intermediate values. As we know, Elixir modules are basically buckets of ...