Three new books, Go Optimizations 101, Go Details & Tips 101 and Go Generics 101 are published now. It is most cost-effective to buy all of them through this book bundle in the Leanpub book store.

Go Optimizations 101

This book provides some code performance optimization tricks, tips, and suggestions, which include

The book is Go 1.23 ready now (update history).

(Please follow Go 101's official Twitter account @zigo_101 to get latest Go 101 news and learn all kinds of Go knowledge.)

Go Optimizations 101

(about 150 pages, 75+ facts and suggestions)

The digital versions of this book are available at the following places:

Honestly speaking, the book is worth $20+.

Tapir, the author of Go 101, has been on writing the Go 101 series books and maintaining the go101.org website since July 2016. New contents are still being (and will be) constantly added to the book series and the website from time to time.

Tapir is also an indie game developer. If you would like to, you can also support the book and the website by playing Tapir's games (made for both Android and iPhone/iPad). Individual donations are also accepted via PayPal.

Thanks to Olexandr Shalakhin for the permission of using one of the wonderful gopher icon images in the book cover.

Index:

  • Acknowledgments
  • About Go Optimizations 101
  • Value Parts and Value Sizes (available in the paid ebooks)
    • value/type sizes
    • memory alignments
    • struct padding
    • avoid larger copy costs
  • Memory Allocations
  • Stack and Escape Analysis (available in the paid ebooks)
    • escape analysis
    • how to control value allocation places
    • stacks growth and shrinkage
    • how to reduce stack grow times
  • Garbage Collection (available in the paid ebooks)
    • GC pacer
    • how to reduce GC pressure
    • control GC frequency
  • Pointers
  • Structs (available in the paid ebooks)
    • 3 facts/suggestions
  • Arrays and Slices (available in the paid ebooks)
    • 10+ facts/suggestions
  • String and Byte Slices (available in the paid ebooks)
    • 10+ facts/suggestions
  • BCE (Bound Check Elimination)
    • the cases BCE works for
    • the cases BCE doesn't work for
    • the cases BCE works for when given hints
  • Maps
  • Channels (available in the paid ebooks)
    • 3 facts/suggestions
  • Functions (available in the paid ebooks)
    • how to make a function inline-able
    • how to make a function not inline-able
    • pointer parameters/results vs. non-pointer ones
    • named results vs. anonymous ones
    • 10+ facts/suggestions
  • Interfaces (available in the paid ebooks)
    • value boxing costs
    • 3+ facts/suggestions

The Go 101 project is hosted on Github. Welcome to improve Go 101 articles by submitting corrections for all kinds of mistakes, such as typos, grammar errors, wording inaccuracies, description flaws, code bugs and broken links.

If you would like to learn some Go details and facts every serveral days, please follow Go 101's official Twitter account @zigo_101.

Tapir, the author of Go 101, has been on writing the Go 101 series books and maintaining the go101.org website since 2016 July. New contents will be continually added to the book and the website from time to time. Tapir is also an indie game developer. You can also support Go 101 by playing Tapir's games (made for both Android and iPhone/iPad):
Individual donations via PayPal are also welcome.