From 1c1133ce8258dad367aad3b7c8eee0083aecf772 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Mon, 19 Oct 2026 07:59:15 +0100 Subject: A list value of numbers copied whole (140's LIST_VALUE review, no new opcode, no change to what a module means): nest() made every list value item by item into a new tree (64 ns an item, 250 ns a copy fixed); an event's list in FLAT arrays, not keyed, its cells numbers, bools and integers, is now copied column by column (pure_list_copied: 600 items 38,268 to 985 ns, 60 items 3,926 to 324); UAX #14's nine lists a line 6,917 to 6,445 ns a code point (-6.8%, the same instructions); JSON tree's, HTTP's and inflate's (trees: texts or lists in their records, or few) as they were; copied_lists in test-module (random lists against item by item, then each changed apart; trees, keys and texts not copied so) --- core/module-list.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/module-list.h') diff --git a/core/module-list.h b/core/module-list.h index 13c2550..98fd5d7 100644 --- a/core/module-list.h +++ b/core/module-list.h @@ -214,6 +214,10 @@ bool pure_list_takes(const PureList *, int key, size_t n, const double *keys, si 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 *); +/* A new event's list with the items of one in FLAT arrays, not keyed, its cells numbers, bools and integers: its + * columns copied whole (what inserting its items one by one into a new list gives, in its form). NULL for any other + * list (copy it item by item) or without memory. */ +PureList *pure_list_copied(const PureList *); /* Field of the item whose key_field is key, in a list ordered by key_field * (seek, then get, as one: a DENSE list reads it at its key); false when no * item has key. */ -- cgit v1.2.3