Benchmarking and Profiling Genetic Algorithms

Learn how to use benchmarking and profiling in genetic algorithms for optimization.

Exploring BEAM

Thus far, we haven’t needed to worry too much about the performance of the algorithms we’ve implemented. The solutions have been small, and we’ve been working with relatively small populations. Because of this, we haven’t needed to be concerned with efficiency. In the real world, however, we’ll often need to deal with significantly larger solutions and populations when applying genetic algorithms to practical problems.

As it turns out, Elixir is a language that wasn’t designed to be extremely efficient at computationally expensive tasks. Things like floating-point, math, and matrix multiplication are slow in Elixir. This is because Elixir runs on the BEAM, which was designed for telecommunication systems. This doesn’t mean we can’t write efficient genetic algorithms in Elixir; it means we need to be deliberate in optimizing those algorithms.

Get hands-on with 1200+ tech skills courses.