add small notes to pprof section

This commit is contained in:
Damian Gryski 2019-04-11 21:42:25 -07:00
parent 4b8adfee5f
commit 9d5a77a3a9
2 changed files with 8 additions and 6 deletions

2
TODO
View File

@ -81,7 +81,6 @@ cgo:
https://www.youtube.com/watch?v=lhMhApWQp2E : cgo gophercon
cgo performance tracking bug: https://github.com/golang/go/issues/9704
videos:
https://gophervids.appspot.com/#tags=optimization
-- figure out which of these are specifically worth listing
@ -191,7 +190,6 @@ papers:
https://www.akkadia.org/drepper/cpumemory.pdf
https://software.intel.com/sites/default/files/article/392271/aos-to-soa-optimizations-using-iterative-closest-point-mini-app.pdf
optimization guides:
http://developer.amd.com/resources/developer-guides-manuals/
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.uan0015b/index.html

View File

@ -902,17 +902,19 @@ More importantly, it also tells you when to stop. Pretty much all optimizations
add code complexity in exchange for speed. And you can *always* make code
faster. It's a balancing act.
TODO(dgryski): How much of this is superfluous given Dave's workshop?
## Tooling
### Introductory Profiling
Techniques applicable to source code in general
This is a quick cheat-sheet for using the pprof tooling. There are plenty of other guides available on this.
Check out https://github.com/davecheney/high-performance-go-workshop.
TODO(dgryski): videos?
1. Introduction to pprof
* go tool pprof (and <https://github.com/google/pprof>)
1. Writing and running (micro)benchmarks
* small, like unit tests
* profile, extract hot code to benchmark, optimize benchmark, profile.
* -cpuprofile / -memprofile / -benchmem
* 0.5 ns/op means it was optimized away -> how to avoid
@ -922,7 +924,9 @@ Techniques applicable to source code in general
* malloc, gc workers
* runtime.\_ExternalCode
1. Macro-benchmarks (Profiling in production)
* net/http/pprof
* larger, like end-to-end tests
* net/http/pprof, debug muxer
* because it's sampling, hitting 10 servers at 100hz is the same as hitting 1 server at 1000hz
1. Using -base to look at differences
1. Memory options: -inuse_space, -inuse_objects, -alloc_space, -alloc_objects
1. Profiling in production; localhost+ssh tunnels, auth headers, using curl.