From 0355eb4e38de4bbc90c0bcef2dbe24f0b397d720 Mon Sep 17 00:00:00 2001 From: Frederic Jung Date: Sun, 1 Nov 2026 14:09:17 +0100 Subject: [PATCH] Routing loop: set up a flow's city tables only once it has exits at the rank; drop the per-rank flow rebuild that cost more than it saved --- src/game/80-simulation/30-compute.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/game/80-simulation/30-compute.js b/src/game/80-simulation/30-compute.js index 3c85e20..6f3a334 100644 --- a/src/game/80-simulation/30-compute.js +++ b/src/game/80-simulation/30-compute.js @@ -222,25 +222,23 @@ function compute(){ const directPass=(rank,pass)=>{const DS=DSEL.get(rank),LOC=rank===DIRECT_RANK[1][1]||rank===DIRECT_RANK[2][1]; for(let fi=0,FN=AF.length;fi1e-6;){let j=i+1;while(j64){let k=0;const A=AF===flows?AF.slice():AF;for(let i=0;i1e-6)A[k++]=A[i];A.length=k;AF=A;} if(DSEL.has(rank)){directPass(rank,pass);continue;} // Index loops in here: plain for…of allocates an iterator per loop until V8 has optimised compute(). for(let fi=0,FN=AF.length;fi