This document contains the transcript from a presentation titled "So You Wanna Go Fast?" by Tyler Treat. Some of the key topics discussed include measuring performance using tools like pprof, how different language features in Go like channels, interfaces, and memory management can impact performance, and techniques for writing concurrent and multi-core friendly code in Go like using read-write mutexes. The overall message is that performance depends greatly on the specific situation and trade-offs must be considered between concurrency, memory usage, and execution speed. Measuring first is emphasized to guide any optimizations.
35. @tyler_treat
âInstead of explicitly using locks to mediate access
to shared data, Go encourages the use of channels
to pass references to data between goroutines.â
https://blog.golang.org/share-memory-by-communicating
94. @tyler_treat
âWe generally donât want sync/atomic to be used
at allâŠExperience has shown us again and again
that very very few people are capable of writing
correct code that uses atomic operationsâŠâ
âIan Lance Taylor
105. @tyler_treat
1. Assign a generation, G1, to eachâš
I-node (empty struct).
2. Add new node by copying I-node with
updated branch and generation then
GCAS, i.e. atomically:âš
- compare I-nodes to detect treeâš
mutations.âš
- compare root generations to detectâš
snapshots.
@tyler_treat
G2
G1
Ctrie
113. @tyler_treat
âPackages that import unsafe may depend on internal
properties of the Go implementation. We reserve the
right to make changes to the implementation that may
break such programs.â
https://golang.org/doc/go1compat