We've seen that performance optimization is a complex topic. As C++ programmers, we are primed to require more performance from our code; the question we asked in this chapter was: is it possible to optimize code written in a functional style?
The answer is—yes, if you measure and if you have a clear goal. Do we need a specific computation to finish more quickly? Do we need to reduce the memory footprint? What area of the application requires the most performance improvements? How much do we want to do weird point optimizations that might need rewriting with the next compiler, library, or platform version? These are all questions you need to answer before moving on to optimize your code.
However, we have seen that functional programming has a huge benefit when it comes to using all the cores on a computer. While we're waiting for the standard implementation...