From be297ead16b41938e84bcc3f1be628bc8725f2f4 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Thu, 1 Oct 2026 05:34:25 +0100 Subject: Count work only under a budget, and say why a view failed only then (017) The work budget added about 26 instructions to every row of a table a host shows (bank, a table of 10,000 rows: +3.0% instructions an ask), which 017's one-app criterion allows at 1%. A sample put most of it in show_given asking every cell why it failed, and the rest in evaluate and the row lookup writing that reason and the count for every cell. Now nothing is counted without a budget (PureApp.work stays), the reason is written only when a view, a cell or a row has no value, and pure-serve asks it only of a cell without one. The table: +0.94%; the other bank queries within 0.4%. The tests that read the count set a budget that is never reached. --- core/module.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/module.h') diff --git a/core/module.h b/core/module.h index c4919c9..2cc3109 100644 --- a/core/module.h +++ b/core/module.h @@ -554,11 +554,11 @@ size_t pure_app_state_bytes(const PureApp *); * item of its list (of its slice, when it takes one) it goes over, all * counted as the fold or walk begins. Past it the event fails with the fault * PURE_FAULT_WORK (PURE_LIMIT) and changes nothing, and a view has no value. - * 0: no budget, at first. */ + * 0: no budget, at first, and then nothing is counted (PureApp.work stays). */ void pure_app_work(PureApp *, uint64_t instructions); /* Why the last view evaluated on this app (or a table's rows asked for) - * had no value: PURE_FAULT_WORK past the work budget, another fault, or - * PURE_FAULT_NONE when it had one. */ + * had no value, once it had none: PURE_FAULT_WORK past the work budget, + * another fault, or PURE_FAULT_NONE. pure_app_rows always says. */ PureFault pure_app_view_fault(const PureApp *); /* Readers on other threads. Right after a save an app can make a snapshot of -- cgit v1.2.3