summaryrefslogtreecommitdiff
path: root/content/posts/001.md
diff options
context:
space:
mode:
authora73x <[email protected]>2024-09-04 09:30:23 +0100
committera73x <[email protected]>2024-09-04 09:30:23 +0100
commit3d6d3fe9344c588dba734ee155b5f08b87840e43 (patch)
tree03a91111552576164f38d3cbc81977bed4b32c50 /content/posts/001.md
parentcdc0dec8a66d94463a3968a72b90bb4e2ec1c170 (diff)
feat(html): add toc + footnotes
Diffstat (limited to 'content/posts/001.md')
-rw-r--r--content/posts/001.md10
1 files changed, 6 insertions, 4 deletions
diff --git a/content/posts/001.md b/content/posts/001.md
index fe1e680..f7d520e 100644
--- a/content/posts/001.md
+++ b/content/posts/001.md
@@ -2,6 +2,8 @@
title: "Go Benchmarking"
tags: posts
---
+
+The benchmark cycle:
1. write a benchmark
2. run a benchmark
3. get a profile
@@ -9,17 +11,17 @@ tags: posts
5. run your tests
6. goto 2.
-## cpuprofile
+# cpuprofile
```shell
go test -test=XXX -bench <regex> -cpuprofile <file>
```
-## memprofile
+# memprofile
```shell
go test -test=XXX -bench <regex> -memprofile <file> -benchmem
```
-## pprof
+# pprof
[pprof usage](https://github.com/google/pprof/blob/main/doc/README.md)
```shell
@@ -27,7 +29,7 @@ go pprof -http=:8080 profile.pb.gz
```
will show a web UI for analysing the profile.
-### views:
+## views
- flame graph: `localhost:8080/ui/flamegraph`
- shows percentage breakdown of how much resource each "call" made.
- clicking a box will make it "100%" allowing for deep diving