From cfa89f64e937ff83221fb5c896bcd6b7585c0b03 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 20 Nov 2025 12:07:12 +1030 Subject: [PATCH] lightningd: don't loop through all commands every time one finishes. When we have many commands, this is where we spend all our time, and it's just for an old assertion. tests/test_coinmoves.py::test_generate_coinmoves (100,000, sqlite3): Time (from start to end of l2 node): 13 seconds **WAS 34** Worst latency: 4.0 seconds **WAS 24* Signed-off-by: Rusty Russell --- lightningd/jsonrpc.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lightningd/jsonrpc.c b/lightningd/jsonrpc.c index 5520fdcec..76baaa2d9 100644 --- a/lightningd/jsonrpc.c +++ b/lightningd/jsonrpc.c @@ -801,11 +801,6 @@ static struct command_result *command_exec(struct json_connection *jcon, if (res == &pending) assert(cmd->pending); - /* The command might outlive the connection. */ - if (jcon) - list_for_each(&jcon->commands, cmd, list) - assert(cmd->pending); - return res; }