ENGLISH

Efficient Go

Book information

Publisher
O'Reilly Media, Inc.
Year
2022
ISBN
9781098105716, 9781098105648
Language
english
Format
PDF
Filesize
3 MB (3361499 bytes)
Edition
4th early release
Pages
\284
Time added
2022-06-24 18:04:43

Description

Software engineers today typically put performance optimizations low on the list of development priorities. But despite significant technological advancements and lower-priced hardware, software efficiency still matters. With this book, Go programmers will learn how to approach performance topics for applications written in this open source language. How and when should you apply performance efficiency optimization without wasting your time? Authors Bartlomiej Plotka and Frederic Branczyk provide the tools and knowledge you need to make your system faster using fewer resources. Once you learn how to address performance in your Go applications, you'll be able to bring small but effective habits to your programming and development cycle. This book shows you how to Continuously monitor for performance and efficiency regressions Find the root cause of performance bottlenecks using metrics, logging, tracing, and profiling Use tools like pprof, go test, benchstat and k6.io to create reliable micro- and macro-benchmarks Improve and optimize your code to meet your goals without sacrificing simplicity and readability Make data-driven decisions by prioritizing changes that make a difference Introduce basic "performance hygiene" in day-to-day Go programming and testing 1. Software Efficiency Matters Motivation For This Book Behind Performance Common Performance Misconceptions Optimized Code is Not Readable You Aren’t Going to Need It (YAGNI) Hardware is Getting Faster and Cheaper We Can Scale Horizontally Instead Time to Market is More Important Be Vigilant to Simplifications Efficiency: The Key to Pragmatic Code Performance Summary 2. Efficient Introduction to Go Basics You Should Know About Go Imperative, Compiled and Statically Typed Language Designed to Improve Serious Codebases Governed by Google, Yet Open Source Simplicity, Safety and Readability are Paramount Packaging and Modules Dependencies Transparency by Default Consistent Tooling Single Way of Handling Errors Strong Ecosystem Unused Import or Variable Causes Build Error Unit Testing and Table Tests Advanced Language Elements Code Documentation as a First Citizen Backwards Compatibility and Portability Go Runtime Object Oriented Programming in Go Is Go “Fast”? Summary 3. Conquering Efficiency Beyond Waste, Optimization is a Zero-Sum Game Reasonable Optimizations Deliberate Optimizations Optimization Challenges Understand Your Goals Efficiency Requirements Should be Formalized Resource Aware Efficiency Requirements Acquiring and Assessing Efficiency Goals Got a Performance Problem? Keep Calm! Optimization Design Levels Efficiency-Aware Development Flow Functionality Phase Efficiency Phase Summary 4. How Go Uses The CPU Resource (or Two) CPU in a Modern Computer Architecture Assembly Understanding Go Compiler CPU and Memory Wall Problem Hierachical Cache System Pipelining and out-of-order execution Hyper-threading Schedulers Operating System Scheduler Go Runtime Scheduler Practical Example of Concurrency in Go Summary 5. How Go Uses Memory Resource Memory Relevance Do we Have a Memory Problem? Physical Memory OS Memory Management Virtual Memory mmap Syscall OS Memory Mapping Go Memory Management Values, Pointers and Memory Blocks Go Allocator Garbage Collection The Three R’s Optimization Method Summary About the Author

Similar books