Back to rankings

dgryski/go-perfbook

Thoughts on Go performance optimization

optimizationperformanceperformance-optimizationperformance-analysis
Star Growth
Stars
10.9k
Forks
598
Weekly Growth
Issues
6
5k10k
May 2016Sep 2019Feb 2023Jul 2026
README

go-perfbook

Buy Me A Coffee

This document outlines best practices for writing high-performance Go code.

The first sections cover writing optimized code in any language. The later sections cover Go-specific techniques.

Multiple Language Versions

Table of Contents

  1. Writing and Optimizing Go code
  2. How to Optimize
    1. Optimization Workflow
    2. Concrete Optimization Tips
  3. Data Changes
  4. Algorithmic Changes
  5. Benchmark Inputs
  6. Program Tuning
  7. Optimization Workflow Summary
  8. Garbage Collection
  9. Runtime and Compiler
  10. Unsafe
  11. Common gotchas with the standard library
  12. Alternate Implementations
  13. CGO
  14. Advanced Techniques
  15. Assembly
  16. Optimizing an Entire Service
  17. Tooling
    1. Profiling
    2. Tracer
  18. Appendix
    1. Implementing Research Papers

Contributing

This is a work-in-progress book in Go performance.

There are different ways to contribute:

  1. add to or summarizes the resources in TODO
  2. add bullet points or new topics to be covered
  3. write prose and flesh out the sections in the book

Eventually sample programs to optimize and exercises will be needed (maybe).

Coordination will be done in the #performance channel on the Gophers slack.

Related repositories
ray-project/ray

Ray is an AI compute engine. Ray consists of a core distributed runtime and a set of AI Libraries for accelerating ML workloads.

PythonPyPIApache License 2.0raydistributed
ray.io
43.3k7.8k
qarmin/czkawka

Multi functional app to find duplicates, empty folders, similar images etc.

FluentOtherduplicatesrust
32.2k1.1k
svg/svgo

⚙️ Node.js tool for optimizing SVG files

JavaScriptnpmMIT Licensesvgminification
svgo.dev
22.6k1.4k
aidenybai/million

Optimizing compiler for React

TypeScriptnpmMIT Licensehacktoberfestmillion
old.million.dev
17.7k598
federico-busato/Modern-CPP-Programming

Modern C++ Programming Course (C++03/11/14/17/20/23/26)

HTMLCreative Commons Attribution Share Alike 4.0 Internationalcppcpp11
federico-busato.github.io/Modern-CPP-Programming/
15.9k1.1k
facebookarchive/prepack

A JavaScript bundle optimizer.

JavaScriptnpmOtherjavascriptoptimization
prepack.io
14.1k412
google/or-tools

Google's Operations Research tools:

C++Apache License 2.0combinatorial-optimizationlinear-programming
developers.google.com/optimization/
13.8k2.4k
kmario23/deep-learning-drizzle

Drench yourself in Deep Learning, Reinforcement Learning, Machine Learning, Computer Vision, and NLP by learning from these exciting lectures!!

HTMLmachine-learningdeep-learning
deep-learning-drizzle.github.io
12.9k3k
memstechtips/Winhance

Application designed to optimize, customize and enhance your Windows experience.

C#Otherwindows-10windows-10-debloat
12k587
bayesian-optimization/BayesianOptimization

A Python implementation of global optimization with gaussian processes.

PythonPyPIMIT Licenseoptimizationgaussian-processes
bayesian-optimization.github.io/BayesianOptimization/index.html
8.7k1.6k
zeux/meshoptimizer

Mesh optimization library that makes meshes smaller and faster to render

C++MIT Licensegpumesh-processing
meshoptimizer.org
8.1k705
google/closure-compiler

A JavaScript checker and optimizer.

JavaScriptnpmApache License 2.0closure-compilerjavascript
developers.google.com/closure/compiler/
7.7k1.2k