From b94de93a5ae36bab5e00b5b479afeb59e9702a61 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Tue, 6 Oct 2026 05:08:16 +0100 Subject: Batch: a batch's appends made at once (pure_list_add_many, a call a chunk of 128) when every list takes its items so (an event's list, no index into it, one append to it: FLAT not keyed at its end, DENSE by keys it holds at its count, HASHED by number; never past its arrays' limit) and the memory budget takes them all (each item only grows what it counts): columns grown and widened once, the first key there already the executor's EXISTS at its round; else round by round as before, tried at once again after a round that changed a list's form. 50,000 DENSE adds 5.18 to 0.65 ms (the compiled code 0.28). APPEND_SOURCE: keys there already at rounds q and p, keys past a DENSE list's from round p, two appends to one list, widened columns, under memory budgets (seeds 1, 2, 3, 5, 23 alike: 31,402 batches at once in seed 23's, 292 by the budget round by round) --- core/module-list.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'core/module-list.h') diff --git a/core/module-list.h b/core/module-list.h index 28c1936..c44366d 100644 --- a/core/module-list.h +++ b/core/module-list.h @@ -186,6 +186,18 @@ bool pure_list_cells(PureList *, PureCells *); bool pure_list_widen(PureList *, unsigned field, uint8_t bytes); /* A batch set cells of it in place: it changed (its version). */ void pure_list_touched(PureList *); +/* Whether n items of numbers and bools go into an event's list at once + * (pure_list_add_many) as one after another they would go, the list + * staying in its form: a FLAT list not keyed (key -1), at its end; a DENSE + * one by keys it holds at its count now; a HASHED one by number (keys: the + * items' key field's cells, in order). *stored and *extra: what + * pure_list_size and pure_list_extra grow by once they are in. */ +bool pure_list_takes(const PureList *, int key, size_t n, const double *keys, size_t *stored, size_t *extra); +/* The n items (fields[f][i]: item i's field f) into a list that takes + * them, as pure_list_insert at its end or pure_list_add puts each in turn + * (its columns grown and widened once): how many went in before one whose + * key it had already (n: all of them); SIZE_MAX when memory ran out. */ +size_t pure_list_add_many(PureList *, size_t n, const double *const *fields); /* What it keeps its items in now: 0 a tree, 1 FLAT arrays, 2 DENSE (for tests and counts). */ unsigned pure_list_form(const PureList *); /* Field of the item whose key_field is key, in a list ordered by key_field -- cgit v1.2.3