Go: Performance Tuning and Benchmarking

Go: Performance Tuning and Benchmarking

35mIntermediate2023-12-19

Authors

Ayan George

Ayan George

Course details

If you’re an intermediate Go developer, you probably already know that benchmarking is crucial for ascertaining and maintaining the performance of your program. In this course, join instructor Ayan George to take your skills to the next level and become a performance tuning and benchmarking MVP. Explore the basics of using the Go test tool and navigating the structure of a benchmark as well as how to manage the benchmark timer, clean up with b.Cleanup(), and use table-driven and parallel benchmarks. Along the way, Ayan covers some of the pitfalls of benchmarking that can compromise overall accuracy.

Skills covered

GoData Resource ManagementDatabase ManagementGoogleProgramming LanguagesSoftware DevelopmentOne-Off

Concepts

Introduction

  • Be a Go benchmarking MVP
  • How to use GitHub Codespaces with this course

Benchmarking Basics

  • What is benchmarking
  • Using the Go test tool
  • How does benchmarking work In Go
  • The structure of a benchmark

Managing the Benchmark Timer

  • Managing the benchmark timer
  • Cleaning up with b.Cleanup()
  • Table-driven benchmarks
  • Parallel benchmarks

Benchmarking Pitfalls Ensuring Benchmark Accuracy

  • Inlined functions
  • Forgetting iterate
  • Bad wall to elapsed time ratio
  • Challenge - Optimizing trace ID generation
  • Solution - Optimizing trace ID Generation

Comparing Benchmarks

  • Using Benchstat

Conclusion

  • Next steps
40,000 Toman