July 20–24, 2015
Portland, OR

Go performance tutorial

1:30pm–5:00pm Tuesday, 07/21/2015
Scale E143/144
Average rating: *****
(5.00, 3 ratings)
Slides:   1-ZIP    2-PDF 

Prerequisite Knowledge

Attendees should have a working knowledge of Go.

Materials or downloads needed in advance

Attendees should have a fully functional Go installation.

They should also install graphviz:

  • OS X: brew install graphviz ghostscript
  • Debian/Ubuntu: apt-get install graphviz ps2pdf
Attendees running OS X should either have a linux VM or use https://godoc.org/rsc.io/pprof_mac_fix to enable native profiling.

Description

We will start with benchmarking:

  • Write and run benchmarks and learn how to interpret and compare the results
  • Benchmark memory usage and throughput
  • Benchmark concurrent code

We’ll then move on to profiling, to help us understand both how to improve performance on our benchmarks as well as how to figure out what to benchmark in the first place.

  • Profile benchmarks and interpret the results
  • Cover common mistakes and road bumps
  • Show how to profile whole programs
  • Demonstrate other kinds of profiles, such as blocking

Last, we’ll discuss basic and advanced techniques that can improve performance problems once identified.

  • Use idiomatic code and the stdlib, and trust the runtime
  • Delay or eliminate conversions between string and []byte
  • Reduce allocations, for example by using free lists, pre-allocated backing arrays, or sync.Pool
  • Reduce contention, for example by shrinking critical sections, using sync.RWMutex, or atomic.Value
  • Ask the compiler for more information and interpret its output
Photo of Josh Bleecher Snyder

Josh Bleecher Snyder

PayPal

Josh Bleecher Snyder is the director of software engineering at PayPal. He was a co-founder/CTO of Card.io, which was acquired by PayPal in 2012. Josh led card.io’s technology development. Before card.io, Josh founded Treeline Labs, an iOS software development company, and was a senior software engineer at AdMob where he was the first iOS engineer. Josh dropped out of the philosophy Ph.D. program at Stanford University (ABD).

Comments on this page are now closed.

Comments

Picture of Josh Bleecher Snyder
Josh Bleecher Snyder
07/21/2015 4:31am PDT

> Any installation instructions for Windows 7/8 ?

The key piece is just to have a working Go 1.4 installation. GraphViz (http://www.graphviz.org/Download_windows.php) is a bonus.

A N
07/21/2015 3:34am PDT

Any installation instructions for Windows 7/8 ?

Picture of Josh Bleecher Snyder
Josh Bleecher Snyder
07/21/2015 12:36am PDT

> How much of a working knowledge of Go will I need? I’ve only been using it for a few months.

A few months should be plenty for almost all of the tutorial. My goal is to make it accessible and interesting to all, so we’ll start with some basics and ramp up to some fairly advanced stuff at the end. And you can always ask questions. :)

Terry Bigelow
07/21/2015 12:33am PDT

Hello. How much of a working knowledge of Go will I need? I’ve only been using it for a few months but I feel like I understand it OK..