From b387b26cb3e2c8aaab81307292544a0376992e50 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 8 May 2025 12:20:47 +0930 Subject: [PATCH] common: don't enable steal loop checking unless we're doing memleak checking. Before: 92.26076173782349 91.9576666355133 90.92732524871826 After: 90.5989830493927 88.10309219360352 90.07689118385315 --- common/daemon.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common/daemon.c b/common/daemon.c index c14de8b07..c3adac2a0 100644 --- a/common/daemon.c +++ b/common/daemon.c @@ -222,8 +222,11 @@ bool daemon_developer_mode(char *argv[]) kill(getpid(), SIGSTOP); } - /* This checks for any tal_steal loops! */ - add_steal_notifiers(NULL); + /* This checks for any tal_steal loops, but it's not free: + * only use if we're already using the fairly heavy memleak + * detection. */ + if (getenv("LIGHTNINGD_DEV_MEMLEAK")) + add_steal_notifiers(NULL); return true; }