From c8f0704b6f88f331be24a89df7d7cb6a4bf29164 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Tue, 29 Sep 2026 06:35:05 +0100 Subject: Keep the outbox as a list: a save logs only the sends and trims it made The sends not yet trimmed were written whole into the links value at every save, as the numbers heard were: a sender whose receiver is away or slow saved all its waiting sends again with each new one. They are now a runtime list {output (its name), seq, payload}, in the order sent, stored as a list state is (image "0sent" and its changes in the log). A send is a change of the list with its event; a trim lets the sends go at once and a failed save brings them back; the host sees the saved ones (sent_saved). Outputs are named in the items, so a module replaced keeps them without moving anything; one that lacks or changed an output with sends left is refused as before. Links stored before (PLK1, PLK2) move their sends to the list at a start and are stored again without them (PLK3). A list field may now hold any bytes (kind 2), unchecked, besides a number and a UTF-8 text. Saving 5,000 sends of 16 KB one by one took 84.8 s and left a store of 400 MB; now 0.91 s and 144 MB. 20,000 of 61 bytes: 8.4 s, now 2.9 s. --- core/module-list.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/module-list.h') diff --git a/core/module-list.h b/core/module-list.h index faacf4b..a4e760a 100644 --- a/core/module-list.h +++ b/core/module-list.h @@ -46,6 +46,8 @@ typedef struct { /* A list holds up to PURE_LIST_ITEMS items, a run up to PURE_LIST_RUN. */ enum { PURE_LIST_ITEMS = 1 << 24, PURE_LIST_RUN = 32 }; +/* text_fields: a field's kind, 0 a number, 1 a text (UTF-8, checked when + * read), 2 bytes (any: a runtime list's). */ PureList *pure_list_new(unsigned fields, const uint8_t *text_fields); void pure_list_free(PureList *); /* Let every item go (retired where a shared copy may read it). */ -- cgit v1.2.3