cln/plugins/test
Matt Whitlock 9112c1d518 common/json_parse_simple: make convenience functions inline
json_tok_streq(…) and json_get_member(…) are convenience wrappers for
json_tok_strneq(…) and json_get_membern(…) respectively. Unfortunately, using
them incurs a performance penalty in the common case where they are called with
a string literal argument because the compiler is unable to substitute a
compile-time constant in place of the buried call to strlen(…).

For example,

	json_get_member(buf, tok, "example");

…will have worse performance than…

	json_get_membern(buf, tok, "example", strlen("example"));

…because the former is forced to scan over "example" at run-time to count its
length whereas the latter is able to elide the strlen(…) call at compile time.

Hoist these convenience functions up into common/json_parse_simple.h and mark
them as inline so that the compiler can elide the strlen(…) call in the common
case of calling these functions with a string literal argument.

Changelog-None
2025-08-14 17:53:39 +09:30
..
Makefile pay: Use the global channel_hint_set and remember across payments 2024-10-07 14:05:47 +02:00
Makefile2 plugins/test/run-route-overlong: modern overlong routing test. 2021-05-22 17:53:04 +09:30
run-funder_policy.c libplugin: allow display of default values. 2024-05-15 15:50:54 -05:00
run-route-calc.c common/json_parse_simple: make convenience functions inline 2025-08-14 17:53:39 +09:30
run-route-overlong.c common/json_parse_simple: make convenience functions inline 2025-08-14 17:53:39 +09:30