From d1080f31d941d78399e67ad2f8108c3344f6c014 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Tue, 6 Oct 2026 05:11:53 +0100 Subject: Batch: a recurrence's steps each an operation of two numbers a round keeps (a step's result, a recurrence's value, the loop's value, a number that stays) rather than a stack's pushes and pops, an operation computed twice in its statement once (x the same until it is done): 1,000,000 rounds of MINSTD 44.4 to 25.7 ms (the compiled code 18.5, the executor alone 73.0); costs/recur.aup --- research/experiments/041-batches/costs/recur.aup | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 research/experiments/041-batches/costs/recur.aup (limited to 'research') diff --git a/research/experiments/041-batches/costs/recur.aup b/research/experiments/041-batches/costs/recur.aup new file mode 100644 index 0000000..fb56004 --- /dev/null +++ b/research/experiments/041-batches/costs/recur.aup @@ -0,0 +1,11 @@ +state out = 0 +input go = message { + n: u32 +} +on go { + let x = 1 + for i in 0 .. go.n * 1000 { + x = x * 48271 - floor(x * 48271 / 2147483647) * 2147483647 + } + out = x +} -- cgit v1.2.3