From f5f87255c1ff668bb23b60d8f8bebb07fe1d74dc Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 23 Apr 2025 09:54:15 +0930 Subject: [PATCH] common/test/run-trace: increase iterations for trivial benchmarking. With an average runtime of 18.7674, this implies 1876ns per trace, which is far in excess of the 370ns claimed in doc/developers-guide/tracing-cln-performance.md. We also add a tag in there, so we measure that! Results on my laptop: real 0m18.524000-19.100000(18.7674+/-0.21)s user 0m16.171000-16.833000(16.424+/-0.26)s sys 0m2.259000-2.400000(2.337+/-0.059)s Signed-off-by: Rusty Russell --- common/test/run-trace.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/test/run-trace.c b/common/test/run-trace.c index 99fd94b69..7811f68c9 100644 --- a/common/test/run-trace.c +++ b/common/test/run-trace.c @@ -13,16 +13,20 @@ int main(int argx, char *argv[]) common_setup(argv[0]); /* Create a bunch of nested spans to emit. */ - for(int i=0; i<25000; i++) { + for(int i=0; i<2500000; i++) { trace_span_start("a", &a); + trace_span_tag(&a, "method", "getrawblockbyheight"); trace_span_start("b", &b); + trace_span_tag(&b, "method", "getrawblockbyheight"); trace_span_start("c", &c); + trace_span_tag(&c, "method", "getrawblockbyheight"); trace_span_end(&c); trace_span_end(&b); trace_span_start("d", &d); + trace_span_tag(&d, "method", "getrawblockbyheight"); trace_span_end(&d); trace_span_end(&a);