9 Persistent data structures

Standing on the shoulders of giants

This chapter covers

  • The internal details of persistent data structures
  • The time and memory efficiency of persistent data structures
  • Using persistent data structures in an application

In part 1, we illustrated how to manage the state of a system without mutating data, where immutability is maintained by constraining ourselves to manipulate the state only with immutable functions using structural sharing. In this chapter, we present a safer and more scalable way to preserve data immutability—representing data with so-called persistent data structures. Efficient implementations of persistent data structures exist for most programming languages via third-party libraries.

9.1 The ...

Get Data-Oriented Programming now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.