From 508527f52de524a4fd174d386808e314b4138b11 Mon Sep 17 00:00:00 2001 From: alex emery Date: Sun, 3 Nov 2024 15:33:28 +0000 Subject: feat: static builds --- public/posts/2024-08-25-01.html | 117 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 public/posts/2024-08-25-01.html (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 new file mode 100644 index 0000000..4bd4371 --- /dev/null +++ b/public/posts/2024-08-25-01.html @@ -0,0 +1,117 @@ + + + + + + + + + + a73x + + + + + +

a73x

+ high effort, low reward + + +

Go Benchmarking

+ +

The benchmark cycle:

+ +
    +
  1. write a benchmark
  2. +
  3. run a benchmark
  4. +
  5. get a profile
  6. +
  7. optimise
  8. +
  9. run your tests
  10. +
  11. goto 2.
  12. +
+ +

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

+ + + + + + + + + -- cgit v1.2.3