Skip to content

Commit f5f8725

Browse files
committed
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 <rusty@rustcorp.com.au>
1 parent 7198fec commit f5f8725

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

common/test/run-trace.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,20 @@ int main(int argx, char *argv[])
1313
common_setup(argv[0]);
1414

1515
/* Create a bunch of nested spans to emit. */
16-
for(int i=0; i<25000; i++) {
16+
for(int i=0; i<2500000; i++) {
1717
trace_span_start("a", &a);
18+
trace_span_tag(&a, "method", "getrawblockbyheight");
1819
trace_span_start("b", &b);
20+
trace_span_tag(&b, "method", "getrawblockbyheight");
1921

2022
trace_span_start("c", &c);
23+
trace_span_tag(&c, "method", "getrawblockbyheight");
2124
trace_span_end(&c);
2225

2326
trace_span_end(&b);
2427

2528
trace_span_start("d", &d);
29+
trace_span_tag(&d, "method", "getrawblockbyheight");
2630
trace_span_end(&d);
2731

2832
trace_span_end(&a);

0 commit comments

Comments
 (0)