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 <rusty@rustcorp.com.au>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user