loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: Run garbage collection before profiling heap

- This avoids returning that some memory is allocated for something
that's actually no longer in used. Go's standard library also does this
for testing and benchmarking when returning memory profiles. A canonical
link that this recommended is the example "To add equivalent profiling
support to a standalone program" in https://pkg.go.dev/runtime/pprof

Gusted ebe6ebe3 3f44b97b

+4
+4
routers/web/admin/diagnosis.go
··· 6 6 import ( 7 7 "archive/zip" 8 8 "fmt" 9 + "runtime" 9 10 "runtime/pprof" 10 11 "runtime/trace" 11 12 "time" ··· 73 74 ctx.ServerError("Failed to create zip file", err) 74 75 return 75 76 } 77 + // To avoid showing memory that actually can be cleaned, run the garbage 78 + // collector. 79 + runtime.GC() 76 80 _ = pprof.Lookup("heap").WriteTo(f, 0) 77 81 }