aboutsummaryrefslogtreecommitdiffstats
path: root/core/module.h
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-10-01 05:34:25 +0100
committereunhhu <[email protected]>2026-10-01 05:34:25 +0100
commitbe297ead16b41938e84bcc3f1be628bc8725f2f4 (patch)
tree0f2e4a17b79781a751b2d8fe21e494384f1f0de6 /core/module.h
parentd24881de03433c30ee619ee1eec3ae962ae3db19 (diff)
downloadpure-be297ead16b41938e84bcc3f1be628bc8725f2f4.tar.gz
pure-be297ead16b41938e84bcc3f1be628bc8725f2f4.zip
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.
Diffstat (limited to 'core/module.h')
-rw-r--r--core/module.h6
1 files changed, 3 insertions, 3 deletions
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