EasyEnv
Engineering/Courses/Catalog/Go/Performance and Profiling
Go
BeginnerLesson 18 of 2040 min · hands-on

Performance and Profiling

Part of the Go course

At some point someone says the service is slow, and you open the code and immediately spot the loop that must be responsible. You rewrite it, it is much cleverer now, and the service is exactly as slow as before, because the actual cost was in a JSON encode three functions away that nobody thought about.

This happens to everyone, repeatedly, and it is not a failure of skill. Programs spend their time in places human intuition is bad at predicting, because the compiler, the garbage collector, and the CPU's caches are all making decisions you did not write. The only reliable way through is to measure, change one thing, and measure again. ...

Want to learn Go Performance and Profiling in a real environment?

Click below, get a fresh Linux box with Go ready to go, and work through Performance and Profiling hands-on with an AI tutor that knows your code.

Start this lessonPerformance and Profiling

What you'll learn

  • Go test -bench
  • Pprof CPU and heap profiles
  • Escape analysis with -gcflags=-m
  • Avoiding unnecessary allocations
  • Preallocating slices
  • Sync.Pool intuition

Read this lesson in your language

All lessons in this course

20 lessons
  1. 1Hello, Go25 min
  2. 2Variables and Types25 min
  3. 3Control Flow: if and for30 min
  4. 4Functions30 min
  5. 5Slices and Maps35 min
  6. 6Structs and Pointers35 min
  7. 7Methods and Interfaces35 min
  8. 8Error Handling35 min
  9. 9Modules and Project Structure35 min
  10. 10Tiny CLI Capstone40 min
  11. 11A Tour of the Standard Library40 min
  12. 12Testing and Benchmarks40 min
  13. 13Goroutines and Channels40 min
  14. 14Concurrency Patterns45 min
  15. 15Generics35 min
  16. 16HTTP Servers45 min
  17. 17Databases with database/sql45 min
  18. 18Performance and Profiling40 min
  19. 19Design Patterns in Go40 min
  20. 20Deployment and Production45 min

Explore other courses

Performance and Profiling - Go (English) | Engineering Courses