From 0c47bc2bc2497771740410bcd965d4d4fd0e3524 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Sat, 26 Sep 2026 07:47:57 +0100 Subject: Let a burst hold up to 256 documents A burst ended once 16 keys had joined it, so 64 writers needed four commits a round and some waited through several (p50 17.4 ms). The pending documents now grow on demand up to 256 keys, which also makes PureApp 1.3 KB smaller (3,128 bytes). With 64 connections a commit now carries 26 events on average instead of 12 and the median PUT waits 9.2 ms; throughput moves less, since each commit writes more and the SD card's syncs take most of the time. --- prototypes/connections/test-module.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'prototypes/connections/test-module.c') diff --git a/prototypes/connections/test-module.c b/prototypes/connections/test-module.c index e1d1ccf..6f48bc8 100644 --- a/prototypes/connections/test-module.c +++ b/prototypes/connections/test-module.c @@ -1697,8 +1697,10 @@ static void deferred_messages(void) { pure_app_stop(&app); /* the last edit was never saved */ CHECK(pure_app_start(&app, &module_a, pure_tree_data(path)) == PURE_OK && app.values[0] == 4 + PURE_APP_PENDING); CHECK(pure_app_message(&app, 0, "k0", -1, (PureSpan){0}) == PURE_OK && app.revision == 2 && replied(&app, "abc")); - CHECK(pure_app_message(&app, 0, "m16", -1, (PureSpan){0}) == PURE_NOT_FOUND); - CHECK(pure_app_message(&app, 0, "m15", -1, (PureSpan){0}) == PURE_OK && replied(&app, "y")); + snprintf(key, sizeof(key), "m%d", PURE_APP_PENDING); + CHECK(pure_app_message(&app, 0, key, -1, (PureSpan){0}) == PURE_NOT_FOUND); + snprintf(key, sizeof(key), "m%d", PURE_APP_PENDING - 1); + CHECK(pure_app_message(&app, 0, key, -1, (PureSpan){0}) == PURE_OK && replied(&app, "y")); pure_app_stop(&app); remove_store(path); } -- cgit v1.2.3