gitwtfhub

wtf is go-perfbook?

dgryski/go-perfbook — explained in plain English

Analysis updated 2026-06-24

10,900Audience · developerComplexity · 2/5Setup · easy

TL;DR

A community-written guide on making Go programs run faster, covering general optimization strategies and Go-specific profiling tools, garbage collection, algorithms, and data structures, available in four languages.

Mindmap

mindmap
  root((go-perfbook))
    General concepts
      Optimization workflow
      Algorithm choice
      Data structures
    Go specific
      GC and memory
      Runtime internals
      Profiling tools
    Advanced topics
      Assembly code
      CGO usage
      Service level perf
    Languages
      English Chinese
      Spanish Portuguese

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Learn a systematic workflow for profiling and optimizing a slow Go service in production

REASON 2

Find Go-specific performance pitfalls in standard library usage before deploying

REASON 3

Study how the Go garbage collector works to reduce GC pauses in a latency-sensitive application

REASON 4

Write meaningful Go benchmark tests that avoid common measurement mistakes

What's in the stack?

Go

How it stacks up

dgryski/go-perfbookgooglechromelabs/ndbopenai/openai-node
Stars10,90010,89910,898
LanguageJavaScriptTypeScript
Setup difficultyeasyeasyeasy
Complexity2/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

Wtf does this do

This repository is a community-written guide on how to make Go programs run faster. Go is a programming language developed by Google and is widely used for building backend services and tools. Performance optimization means identifying where a program spends unnecessary time or memory, then changing the code to fix it. The guide is organized as a single long document (with a table of contents) split into two broad halves. The first half covers optimization ideas that apply to any programming language, such as how to think about optimization as a workflow, how to pick better algorithms, how to structure data so it is faster to access, and how to write meaningful benchmark tests. The second half focuses specifically on Go: how Go handles memory cleanup (called garbage collection), how its runtime and compiler work under the hood, how to use profiling tools to find slow spots in a running program, and when to use lower-level techniques like writing in assembly language. There are also sections on common mistakes when using Go's standard library, how to call C code from Go (a feature called CGO), and how to think about performance at the level of an entire service rather than a single function. The document is available in English, Chinese, Spanish, and Brazilian Portuguese. It is described as a work in progress, and contributions are welcome through the Gophers community Slack channel. The README is short, the main content lives in the linked markdown files inside the repository.

Yoink these prompts

Prompt 1
Using go-perfbook as a reference, help me profile my Go HTTP server with pprof to find where it spends the most time and suggest concrete fixes
Prompt 2
Based on go-perfbook advice on data structures, review this Go struct and suggest how to reorder fields to improve cache locality
Prompt 3
Using go-perfbook guidance on benchmarking, help me write a Go benchmark for my string processing function that avoids common measurement pitfalls
Prompt 4
Apply the go-perfbook recommendations for reducing garbage collector pressure to this high-throughput Go service code

Frequently asked questions

wtf is go-perfbook?

A community-written guide on making Go programs run faster, covering general optimization strategies and Go-specific profiling tools, garbage collection, algorithms, and data structures, available in four languages.

How hard is go-perfbook to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is go-perfbook for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.