perf(site-runtime): warm the next startup batch during the stagger delay and compile a batch's distinct units in parallel (review 2026-10-21 01/SR-P3)

DeployCompileValidator.WarmCompileCache dedupes script bodies/trigger
expressions across a batch and compiles them with Parallel.ForEach (half the
cores). CreateInstanceActorBatch starts the next batch's warm as it arms the
stagger timer; creation order and delay are unchanged. The warm's parsed
configs are reused at creation.
This commit is contained in:
Joseph Doherty
2026-10-22 08:22:26 -04:00
parent dde22a3dd1
commit 999653a6b9
5 changed files with 256 additions and 29 deletions
@@ -292,8 +292,10 @@ public class DeploymentWarmThenGateTests : TestKit, IDisposable
AwaitAssert(() =>
{
// One compile, then repeated hits: the second pre-warm plus both PreStarts.
Assert.True(_compileCache.Hits >= 3,
// One compile, then repeated hits from both PreStarts. (The batch warm dedupes
// distinct bodies before compiling — review 2026-10-21 01/SR-P3 — so the second
// config no longer costs a warm-side lookup of its own.)
Assert.True(_compileCache.Hits >= 2,
$"expected the pre-warmed body to be served from cache, saw {_compileCache.Hits} hits");
}, TimeSpan.FromSeconds(20));