O'Reilly logo

Real-World Functional Programming with Examples in F# and C# by Jon Skeet, Tomas Petricek

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10. Efficiency of data structures

This chapter covers

  • Optimizing and improving recursive functions
  • Using tail-recursion and continuations
  • Working efficiently with lists and arrays

So far in this book, we’ve used functional techniques such as recursion and functional data structures like immutable lists. We’ve written the code in the most straightforward way we could, using the basic F# collection type (a list) and expressing our intentions directly. This works very well in many situations, but when it comes to processing large data sets, “obvious” code sometimes leads to performance problems. In this chapter, we’ll look at techniques for writing code that work regardless of the size of the input and examine ways to optimize the performance ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required