Profiling Go code
A beginners tutorial
Go Stockholm Meetup #7 “High Performance Go”
Dec 5th 2013

Samuel Lampa
@smllmp
+sa...
Enable profiling: Standard way

Not terribly user friendly :/
… especially compared to python:
But, thanks to this Guy at Canonical
(Dave Cheney) ...

●
●

dave.cheney.net
twitter.com/davecheney
… we can now enable profiling
in a much easier way:
How to run it
How to run it
How to run it
Call graph as PDF, weighted by execution time
A few more options ...
Zoomable / Scrollable SVG in browser
A few performance tricks
for string processing...
Version 1
Version 2 – Table optimization
Version 3 – Using bufio Scanner(), new in Go 1.2
Version 4 – Using pointers for counters
Performance improvement, version 1-4
Creds goes to ...
●

●

Roger Peppe, also at Canonical, for
help with the optimizations, and the
final optimized version!
...
Learn more
●

blog.golang.org/profiling-go-programs

●

tinyurl.com/go-pprof-win (Using pprof on Windows)

●

blog.cloudfl...
Thank you!
Upcoming SlideShare
Loading in...5
×

Profiling go code a beginners tutorial

913

Published on

Published in: Technology, Spiritual
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
913
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
13
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Profiling go code a beginners tutorial

  1. 1. Profiling Go code A beginners tutorial Go Stockholm Meetup #7 “High Performance Go” Dec 5th 2013 Samuel Lampa @smllmp +samuellampa saml.rilspace.org Developer at www.uppmax.uu.se, www.farmbio.uu.se, rilpartner.se
  2. 2. Enable profiling: Standard way Not terribly user friendly :/
  3. 3. … especially compared to python:
  4. 4. But, thanks to this Guy at Canonical (Dave Cheney) ... ● ● dave.cheney.net twitter.com/davecheney
  5. 5. … we can now enable profiling in a much easier way:
  6. 6. How to run it
  7. 7. How to run it
  8. 8. How to run it
  9. 9. Call graph as PDF, weighted by execution time
  10. 10. A few more options ...
  11. 11. Zoomable / Scrollable SVG in browser
  12. 12. A few performance tricks for string processing...
  13. 13. Version 1
  14. 14. Version 2 – Table optimization
  15. 15. Version 3 – Using bufio Scanner(), new in Go 1.2
  16. 16. Version 4 – Using pointers for counters
  17. 17. Performance improvement, version 1-4
  18. 18. Creds goes to ... ● ● Roger Peppe, also at Canonical, for help with the optimizations, and the final optimized version! twitter.com/rogpeppe
  19. 19. Learn more ● blog.golang.org/profiling-go-programs ● tinyurl.com/go-pprof-win (Using pprof on Windows) ● blog.cloudflare.com/recycling-memory-buffers-in-go ● saml.rilspace.org/moar-languagez-gc-content-in-pytho n-d-fpc-c-and-c Also, don't miss ● gplus.to/golangplus ● golangweekly.com
  20. 20. Thank you!
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×