Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Bartlomiej Plotka

With technological advancements, fast markets, and higher complexity of systems, software engineers tend to skip the uncomfortable topic of software efficiency. However, tactical, observability-driven performance optimizations are vital for every product to save money and ensure business success. With this book, any engineer can learn how to approach software efficiency effectively, professionally, and without stress. Author Bartłomiej Płotka provides the tools and knowledge required to make your systems faster and less resource-hungry. Efficient Go guides you in achieving better day-to-day efficiency using Go. In addition, most content is language-agnostic, allowing you to bring small but effective habits to your programming or product management cycles. This book shows you how to: • Clarify and negotiate efficiency goals • Optimize efficiency on various levels • Use common resources like CPU and memory effectively • Assess efficiency using observability signals like metrics, logging, tracing, and (continuous) profiling via open source projects like Prometheus, Jaeger, and Parca • Apply tools like go test, pprof, benchstat, and k6 to create reliable micro and macro benchmarks • Efficiently use Go and its features like slices, generics, goroutines, allocation semantics, garbage collection, and more!

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
# Efficient Go: Data-Driven Performance Optimization ## 【One-Line Pitch】 A practical, observability-first guide to making Go systems faster and more resource-efficient without guesswork—essential reading for backend engineers, SREs, and tech leads who want to replace "optimization anxiety" with data-driven confidence. ## 【Book Arc】 - **Opening (~0%–25%)**: Establishes why software efficiency matters in modern business contexts, debunks common misconceptions (e.g., "optimized code isn't readable," "hardware is getting faster anyway," "we can just scale horizontally"), and introduces the core philosophy: pragmatic, goal-driven optimization over premature or dogmatic optimization. - **Early (~25%–50%)**: Provides an efficient introduction to Go itself—its design philosophy (simplicity, safety, readability), packaging/modules, tooling, error handling, testing patterns, generics, and runtime characteristics—so readers share a common language before diving into performance work. - **Middle (~50%–75%)**: Introduces the "Conquering Efficiency" framework: formalizing efficiency requirements (including Resource-Aware Efficiency Requirements, or RAER), understanding optimization as a zero-sum game, distinguishing reasonable vs. deliberate optimizations, and following an efficiency-aware development flow with separate functionality and efficiency phases. - **Late (~75%–100%)**: Dives deep into how Go actually uses CPU resources—modern computer architecture, assembly, the Go compiler, cache hierarchies, pipelining, hyper-threading, OS and Go runtime schedulers, and when concurrency is truly warranted—followed by a parallel deep-dive into memory resource usage. ## 【Key Takeaways】 - **Efficiency is a business imperative, not a luxury** (Opening): Tactical, observability-driven optimization saves money and ensures product success; skipping it is a strategic risk in fast-moving markets. - **Most common efficiency excuses are myths** (Opening): "Optimized code is unreadable," "YAGNI," "hardware gets faster," "we can scale horizontally," and "time to market matters more" are all debunked as oversimplifications that lead to costly inefficiency. - **Optimization is a zero-sum game** (Middle): Every optimization trades something (readability, complexity, time, other resources); the key is understanding what you're trading and why, rather than optimizing blindly. - **Formalize efficiency goals as RAER** (Middle): Resource-Aware Efficiency Requirements turn vague "make it faster" wishes into measurable, testable targets—essential for negotiating with stakeholders and avoiding endless optimization loops. - **Separate functionality from efficiency phases** (Middle): The recommended development flow deliberately separates building features from optimizing them, preventing premature optimization while ensuring efficiency gets dedicated attention. - **Go's design prioritizes simplicity and safety** (Early): Understanding Go's philosophy—compiled, statically typed, readable, with consistent tooling and single error-handling style—is prerequisite to understanding its performance characteristics. - **CPU efficiency requires understanding the hardware** (Late): Modern CPU architecture (caches, pipelining, out-of-order execution, hyper-threading) and both OS and Go runtime schedulers determine real-world performance; concurrency is a tool, not a default answer. ## 【Reading Tips】 - **Skim Chapter 2 if you're already fluent in Go**: The "Efficient Introduction to Go" covers basics (packaging, errors, testing) that experienced Go developers can skip; focus instead on the runtime and generics sections. - **Deep-read Chapter 3 (Conquering Efficiency)**: This is the conceptual heart of the book—the RAER framework and efficiency-aware development flow are the most transferable, language-agnostic takeaways. - **Treat Chapters 4–5 as reference material**: The CPU and memory deep-dives are dense; read them once for mental models, then return when you encounter specific performance problems. - **Pair with hands-on practice**: The book references tools like `go test`, `pprof`, `benchstat`, and `k6`—have a Go project ready to experiment with as you read. - **Take notes on the "efficiency mindset"**: The book's most valuable lesson is a repeatable process (goal → measure → optimize → verify), not specific tricks; capture that workflow for your own projects. ## 【Coverage Limits】 The excerpts cover the book's front matter, table of contents, and introductory sections in detail; specific benchmark examples, code samples, and the full depth of the CPU/memory chapters are not represented in this guide. ##
Excerpt 1
书名: Efficient Go Data-Driven Performance Optimization (Bartlomiej Plotka) (Z-Library) 作者: Bartlomiej Plotka With technological advancements, fast markets, an...
View in text
Page 2
.99 ISBN: 978-1-098-10571-6 Twitter: @oreillymedia linkedin.com/company/oreilly-media youtube.com/oreillymedia With technological advancements, fast markets,...
View in text
Page 4
ll rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reill...
View in text
Page 5
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix 1. Software Efficiency Matters. . . . . . . . . . . . . . . . . . ...
View in text
Page 6
source (or Two). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 CPU in a Modern Computer Architecture 113 Assembly 115 Underst...
View in text
Tags
AI categories
GoBackendCloud Native
ISBN: 1098105710
Publisher: O'Reilly Media
Publish Year: 2022
Language: Chinese
Pages: 498
File Format: PDF
File Size: 8.8 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…