commit 1a6568decaf3e181f0ac7986c5a15085c0a6ba75
parent 1b2f4c41df984cc32e16e7e819925158dfee64fb
Author: William Casarin <jb55@jb55.com>
Date: Mon, 8 Jan 2024 12:09:20 -0800
nostrdb/perf: add some flamegraph helpers to makefile
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/nostrdb/Makefile b/nostrdb/Makefile
@@ -159,6 +159,18 @@ testdata/many-events.json: testdata/many-events.json.zst
bench: bench-ingest-many.c $(DEPS)
$(CC) $(CFLAGS) $< $(LDS) -o $@
+perf.out: fake
+ perf script > $@
+
+perf.folded: perf.out
+ stackcollapse-perf.pl $< > $@
+
+ndb.svg: perf.folded
+ flamegraph.pl $< > $@
+
+flamegraph: ndb.svg
+ browser $<
+
run-bench: testdata/many-events.json bench
./bench
@@ -169,4 +181,4 @@ testdata/db/.dir:
test: test.c $(DEPS) testdata/db/.dir
$(CC) $(CFLAGS) test.c $(LDS) -o $@
-.PHONY: tags clean
+.PHONY: tags clean fake