From a783270b09af3d873c08a01d13f802018b69fb02 Mon Sep 17 00:00:00 2001 From: a73x Date: Sun, 29 Dec 2024 19:13:27 +0000 Subject: new markdown renderer since TOC has a title now and it can compact toc headers, we can use header 2 for everything use the built in goldmark extension for syntax highlighting --- public/posts/2024-08-25-01.html | 80 +++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 44 deletions(-) (limited to 'public/posts/2024-08-25-01.html') diff --git a/public/posts/2024-08-25-01.html b/public/posts/2024-08-25-01.html index f2b48cf..a678b92 100644 --- a/public/posts/2024-08-25-01.html +++ b/public/posts/2024-08-25-01.html @@ -25,39 +25,38 @@ +
← Posts

Go Benchmarking

-

The benchmark cycle:

-
  1. write a benchmark
  2. run a benchmark
  3. @@ -66,50 +65,43 @@
  4. run your tests
  5. goto 2.
- -

cpuprofile

-
go test -test=XXX -bench <regex> -cpuprofile <file>
-
-

memprofile

-
go test -test=XXX -bench <regex> -memprofile <file> -benchmem
-
-

pprof

- +

cpuprofile

+
go test -test=XXX -bench <regex> -cpuprofile <file>
+

memprofile

+
go test -test=XXX -bench <regex> -memprofile <file> -benchmem
+

pprof

pprof usage

-
go pprof -http=:8080 profile.pb.gz
-
-

will show a web UI for analysing the profile.

- -

views

- +
go pprof -http=:8080 profile.pb.gz
+

will show a web UI for analysing the profile.

+

views

+
  • top: localhost:8080/ui/top -
  • + + + +
  • source: localhost:8080/ui/source -
  • + + + + -- cgit v1.2.3