Performance Tuning and Benchmarking
Have you ever wondered how to determine if your Go code is performing at its best?
Benchmarks help you spot slow code and fix it. They also help you choose the best data structures and algorithms. By the end of this book, you will know how to write benchmarks that guide your engineering decisions.
What you will learn
By reading through the book and completing the exercises, you will learn:
- How to write benchmarking tests from scratch
- How to convert your regular tests into benchmarks
- How to interpret benchmarking results
- How to structure table-driven benchmarks
- How to run benchmarks in parallel
- How to avoid common mistakes
- How to compare benchmarks
- How to speed up code and reduce memory use by choosing the right data structures and algorithms
- How to run benchmarking as a part of CI pipelines using GitHub Action
By mastering these skills, you will improve your understanding of the code. It will help you decide if your project requires refactoring. And if you or your team are making effective use of engineering time. With data on how and why to improve the code, you’ll be better able to make a business case for a change request.
You will learn if and why chasing nanoseconds wastes engineering time in some cases. Knowing trade-offs and making informed decisions will make you a better engineer.
Table of Contents
- Inroduction to benchmarking
- Using the Go test tool
- Benchmarking internals
- Structuring benchmarks
- Managing the benchmark timer
- Cleaning up after benchmarks
- Running table-driven benchmarks
- Running benchmarks in parallel
- Ensuring benchmarks accuracy
- Comparing benchmarks
- Running benchmarks in CI pipelines
Join my mailing list to be the first to know when I release the first chapter.