From c00b8b7f9f763cc63aa49c7e42fe7214fa439291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Mon, 4 Jul 2022 14:33:46 +0300 Subject: [PATCH] add notes re. profiling --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 1d127a5..d89517f 100644 --- a/README.md +++ b/README.md @@ -378,6 +378,30 @@ These are desired for the next DB format: - Compress strings with fsst. - Trim first 4 bytes from the cmph headers. +Profiling +--------- + +Prepare `profile.data`: + +``` +zig build -Drelease-small=true +perf record --call-graph=dwarf \ + zig-out/bin/turbo-unix2db --passwd passwd2 --group group2 +``` + +Perf interactive: + +``` +perf report -i perf.data +``` + +Flame graph: + +``` +perf script | inferno-collapse-perf > stacks.folded +inferno-flamegraph stacks.folded > profile.svg +``` + [git-subtrac]: https://apenwarr.ca/log/20191109 [cmph]: http://cmph.sourceforge.net/ [id]: https://linux.die.net/man/1/id