Chapter 7. The Importance of Being Lazy
Another way of improving an application's performance is by deferring the execution of code until the result is needed. This sounds very logical; the less the code we run, the less the time it will take. This design pattern is usually called lazy. There are many things that can be lazy, and there are many different ways in which we can defer code execution. We are going to cover the following topics in this chapter:
- The lazy mindset
- Lazy loading
- Lazy collections and evaluation