Routing loop: keep flows in typed-array columns instead of objects, and add up link and transit totals without boxing numbers

Flows are packed into Float64Array/Int32Array columns; R.fl builds the old
objects only when read. Edge egress sums keep a slot per egress in a plain
array, and R.tNet is added up in a typed array and written out at the end,
in the same key order. Results are identical to main.
This commit is contained in:
Frederic Jung 2026-11-01 14:27:45 +01:00
parent 0355eb4e38
commit 89fc8b8d03
No known key found for this signature in database
3 changed files with 73 additions and 57 deletions

View file

@ -23,7 +23,7 @@ function network(ev) {
// Share the model and path sender, but replace indexed exit selection with
// the original full scan and stable sort for every flow.
const source = ev('compute.toString()');
const start = source.indexOf(' for(const pass of PASSES||[null])for(const rank of RANKS){');
const start = source.indexOf(' for(const pass of PASSES)for(const rank of RANKS){');
const end = source.indexOf(' for(const i of NORD)', start);
assert.ok(start >= 0 && end > start, 'allocation loop boundaries must exist');
ev(`window.referenceCompute=eval('('+${JSON.stringify(source.slice(0,start)+referenceAllocation+source.slice(end))}+')')`);