chapter one

1 Introduction

 

This chapter covers

  • Defining what latency means
  • Measuring latency
  • Motivating optimizing for latency
  • Comparing latency to throughput and bandwidth
  • Trade-offs when optimizing for latency

This book is about how to build low-latency applications.

Latency is so important across a variety of use cases today. Still, it's a tricky topic because many low-latency techniques are effectively developer folklore hidden in blog posts, mailing lists, and side notes in books. When faced with a latency problem, understanding what you're even dealing with often takes a lot of time. I remember multiple occasions where I saw peculiar results from benchmarks, which resulted in an adventure down the software and hardware stack where I learned something new.

By reading this book, you will understand latency better, how you can measure latency accurately, and discover the different techniques for achieving low latency. This is the book I always wished I had when grappling with latency issues. Although this book focuses on applying the techniques in practice, I will also bring up enough of the background side of things to try to balance between theory and practice.

1.1 What is latency?

1.2 How is latency measured?

1.3 Why does latency matter?

1.3.1 User experience

1.3.2 Real-time systems

1.3.3 Efficiency

1.4 What latency is not?

1.5 Latency vs. bandwidth

1.6 Latency vs. energy

1.7 Summary