Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Profiling Go Applications w | Go Programming Bootcamp lesson | BraveProgrammer
  1. Courses
  2. /
  3. Go Programming Bootcamp

Lesson 32 of 60

·Go

Profiling Go Applications with pprof

15 minutes

Course progress53%

Runtime Profilers

This lesson explains the main concept clearly with beginner-friendly examples and background so you can learn why the code works.

The net/http/pprof package exposes profiling data over HTTP.

import _ "net/http/pprof"

func main() {
      { http.ListenAndServe(, ) }()
    
}
go
func()
":6060"
nil
// rest of your app …

Visit http://localhost:6060/debug/pprof/ and click heap, goroutine, profile.

Generating a CPU profile manually

$ go test -bench=BenchmarkXYZ -benchmem -cpuprofile=cpu.out
$ go tool pprof cpu.out
(pprof) top

Visualizing with graphviz

$ go tool pprof -http=:8080 cpu.out

Info

Enable runtime/trace for detailed execution traces (go tool trace).
Make it stickPractice what you've learned1 quiz · 3 practical tests · Optional activities from Go Programming BootcampBrowse activities
Previous lessonBuilding and Publishing a Go BinaryContinue to lesson 33Working with Environment VariablesBack to Go Programming Bootcamp curriculum