mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
lightningd: always do incremental parsing of JSON inputs.
time lightning-cli -R --network=regtest --lightning-dir /tmp/ltests-k8jhvtty/test_pay_stress_1/lightning-1/ listpays > /dev/null Before: real 0m42.741s user 0m0.149s sys 0m0.016s After: real 0m13.674s user 0m0.131s sys 0m0.024s Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Fixed: JSON-RPC: significant speedups for plugins which create large JSON replies (e.g. listpays on large nodes).
This commit is contained in:
@@ -56,6 +56,8 @@ struct plugin {
|
||||
/* Stuff we read */
|
||||
char *buffer;
|
||||
size_t used, len_read;
|
||||
jsmn_parser parser;
|
||||
jsmntok_t *toks;
|
||||
|
||||
/* Our json_streams. Since multiple streams could start
|
||||
* returning data at once, we always service these in order,
|
||||
|
||||
Reference in New Issue
Block a user