perf(streaming): quiesce retired generations and budget teardown
Publish the retail blocking-for-cells edge before deferred recenter work, freeze old-world presentation/simulation/audio, and advance full-window retirement from exact metered entity and owner cursors. This removes synchronous portal teardown without allowing retained owners to remain observable.
This commit is contained in:
parent
b8f6317fe1
commit
bb16f74fd4
38 changed files with 1691 additions and 170 deletions
|
|
@ -10,6 +10,8 @@ internal sealed class WorldRevealCoordinator
|
|||
{
|
||||
private readonly WorldRevealReadinessBarrier _readiness;
|
||||
private readonly WorldRevealLifecycleTelemetry _lifecycle;
|
||||
private readonly WorldGenerationQuiescence? _quiescence;
|
||||
private long _activeGeneration;
|
||||
|
||||
public WorldRevealCoordinator(
|
||||
Func<uint, int, bool> isRenderNeighborhoodReady,
|
||||
|
|
@ -19,7 +21,8 @@ internal sealed class WorldRevealCoordinator
|
|||
Action<uint, int> prepareCompositeTextures,
|
||||
Action invalidateCompositeTextures,
|
||||
Func<uint, bool> isSpawnClaimUnhydratable,
|
||||
Action<string>? log = null)
|
||||
Action<string>? log = null,
|
||||
WorldGenerationQuiescence? quiescence = null)
|
||||
{
|
||||
_readiness = new WorldRevealReadinessBarrier(
|
||||
isRenderNeighborhoodReady,
|
||||
|
|
@ -30,6 +33,7 @@ internal sealed class WorldRevealCoordinator
|
|||
invalidateCompositeTextures,
|
||||
isSpawnClaimUnhydratable);
|
||||
_lifecycle = new WorldRevealLifecycleTelemetry(log);
|
||||
_quiescence = quiescence;
|
||||
}
|
||||
|
||||
public WorldRevealLifecycleSnapshot Snapshot => _lifecycle.Snapshot;
|
||||
|
|
@ -38,7 +42,10 @@ internal sealed class WorldRevealCoordinator
|
|||
public long Begin(WorldRevealKind kind)
|
||||
{
|
||||
_readiness.Begin();
|
||||
return _lifecycle.Begin(kind);
|
||||
long generation = _lifecycle.Begin(kind);
|
||||
_activeGeneration = generation;
|
||||
_quiescence?.Begin(generation);
|
||||
return generation;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -63,7 +70,25 @@ internal sealed class WorldRevealCoordinator
|
|||
public void ObserveWorldViewportVisible() =>
|
||||
_lifecycle.ObserveWorldViewportVisible();
|
||||
|
||||
public void Complete() => _lifecycle.Complete();
|
||||
public void Complete()
|
||||
{
|
||||
_lifecycle.Complete();
|
||||
EndQuiescence();
|
||||
}
|
||||
|
||||
public void Cancel() => _lifecycle.Cancel();
|
||||
public void Cancel()
|
||||
{
|
||||
_lifecycle.Cancel();
|
||||
EndQuiescence();
|
||||
}
|
||||
|
||||
private void EndQuiescence()
|
||||
{
|
||||
long generation = _activeGeneration;
|
||||
if (generation == 0)
|
||||
return;
|
||||
|
||||
_activeGeneration = 0;
|
||||
_quiescence?.End(generation);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue