cln/plugins/bkpr/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 bkpr: fix unittest when HAVE_USDT=1 2025-04-24 17:34:12 +09:30
run-bkpr_db.c common/json_parse_simple: make convenience functions inline 2025-08-14 17:53:39 +09:30
run-recorder.c common/json_parse_simple: make convenience functions inline 2025-08-14 17:53:39 +09:30
test_utils.h bkpr-tests: first test of plugin bkpr database 2022-07-28 12:08:18 +09:30