Hands-On High Performance with Go
Boost and optimize the performance of your Golang applications at scale with resilience
Bob Strecansky
- 406 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
Hands-On High Performance with Go
Boost and optimize the performance of your Golang applications at scale with resilience
Bob Strecansky
About This Book
Proven methodologies and concurrency techniques that will help you write faster and better code with Go programming
Key Features
- Explore Go's profiling tools to write faster programs by identifying and fixing bottlenecks
- Address Go-specific performance issues such as memory allocation and garbage collection
- Delve into the subtleties of concurrency and discover how to successfully implement it in everyday applications
Book Description
Go is an easy-to-write language that is popular among developers thanks to its features such as concurrency, portability, and ability to reduce complexity. This Golang book will teach you how to construct idiomatic Go code that is reusable and highly performant.
Starting with an introduction to performance concepts, you'll understand the ideology behind Go's performance. You'll then learn how to effectively implement Go data structures and algorithms along with exploring data manipulation and organization to write programs for scalable software. This book covers channels and goroutines for parallelism and concurrency to write high-performance code for distributed systems. As you advance, you'll learn how to manage memory effectively. You'll explore the compute unified device architecture (CUDA) application programming interface (API), use containers to build Go code, and work with the Go build cache for quicker compilation. You'll also get to grips with profiling and tracing Go code for detecting bottlenecks in your system. Finally, you'll evaluate clusters and job queues for performance optimization and monitor the application for performance regression.
By the end of this Go programming book, you'll be able to improve existing code and fulfill customer requirements by writing efficient programs.
What you will learn
- Organize and manipulate data effectively with clusters and job queues
- Explore commonly applied Go data structures and algorithms
- Write anonymous functions in Go to build reusable apps
- Profile and trace Go apps to reduce bottlenecks and improve efficiency
- Deploy, monitor, and iterate Go programs with a focus on performance
- Dive into memory management and CPU and GPU parallelism in Go
Who this book is for
This Golang book is a must for developers and professionals who have an intermediate-to-advanced understanding of Go programming, and are interested in improving their speed of code execution.
Frequently asked questions
Information
Section 1: Learning about Performance in Go
- Chapter 1, Introduction to Performance in Go
- Chapter 2, Data Structures and Algorithms
- Chapter 3, Understanding Concurrency
- Chapter 4, STL Algorithm Equivalents in Go
- Chapter 5, Matrix and Vector Computation in Go
Introduction to Performance in Go
- Understanding performance in computer science
- A brief history of Go
- The ideology behind Go performance
Technical requirements
- The Go reference specification: https://golang.org/ref/spec
- How to write Go code: https://golang.org/doc/code.html
- Effective Go: https://golang.org/doc/effective_go.html
Understanding performance in computer science
- Decreased response time: The total amount of time it takes to respond to a request.
- Decreased latency: The time delay between a cause and effect within a system.
- Increased throughput: The rate at which data can be processed.
- Higher scalability: More work can be processed within a contained system.
A brief note on Big O notation
Methods to gauge long term performance
- Brendan Gregg's USE Method: Utilization, saturation, and errors (www.brendangregg.com/usemethod.html)
- Tom Wilkie's RED Metrics: Requests, errors, and duration (https://www.weave.works/blog/the-red-method-key-metrics-for-microservices-architecture/)
- Google SRE's four Golden Signals: Latency, traffic, errors, and saturation (https://landing.google.com/sre/sre-book/chapters/monitoring-distributed-systems/)