Table of Contents

Class RenderingOptimizations

Namespace
EncDotNet.S100.Renderers.Mapsui
Assembly
EncDotNet.S100.Renderers.Mapsui.dll

Central, mutable configuration for the Mapsui vector-rendering optimizations surfaced in the viewer's Settings → Map section.

public static class RenderingOptimizations
Inheritance
RenderingOptimizations
Inherited Members

Remarks

Each knob is seeded from the environment variable that used to be its sole control (so headless tooling and perf runs keep working unchanged), and may then be overridden at runtime by the viewer's settings.

When an environment variable is explicitly set (present and non-empty) it takes precedence: the matching …EnvExplicit flag is true and subsequent programmatic writes are ignored. This keeps perf measurements faithful — a run started with S100_VECTOR_TILE_METATILE=0 stays off regardless of the persisted user setting. Normal users (no env var) get fully live-toggleable knobs.

See docs/design/mapsui-performance.md for the measurements behind the default choices.

Fields

DefaultTileBudgetMb

Default per-layer hot-cache native budget, in MB (S100_VECTOR_TILE_BUDGET_MB).

public const double DefaultTileBudgetMb = 256

Field Value

double

DefaultTileDiskMb

Default warm disk-cache budget, in MB (S100_VECTOR_TILE_DISK_MB).

public const double DefaultTileDiskMb = 512

Field Value

double

DefaultTileGpuBudgetMb

Default per-layer GPU-residency budget, in MB (S100_VECTOR_TILE_GPU_MB).

public const double DefaultTileGpuBudgetMb = 256

Field Value

double

DefaultTileGutterDip

Default tiled-base-plane gutter, in DIP (S100_VECTOR_TILE_GUTTER).

public const double DefaultTileGutterDip = 64

Field Value

double

MaxSkiaGpuResourceMb

Minimum / maximum accepted Skia GPU resource-cache budget, in MB (S100_SKIA_GPU_RESOURCE_MB).

public const double MaxSkiaGpuResourceMb = 4096

Field Value

double

MaxTileBudgetMb

Minimum / maximum accepted per-layer hot-cache native budget, in MB.

public const double MaxTileBudgetMb = 4096

Field Value

double

MaxTileDiskMb

Minimum / maximum accepted warm disk-cache budget, in MB.

public const double MaxTileDiskMb = 8192

Field Value

double

MaxTileGpuBudgetMb

Minimum / maximum accepted per-layer GPU-residency budget, in MB.

public const double MaxTileGpuBudgetMb = 4096

Field Value

double

MaxTileGutterDip

Minimum / maximum accepted tiled-base-plane gutter, in DIP.

public const double MaxTileGutterDip = 256

Field Value

double

MaxTileWorkers

Minimum / maximum accepted concurrent tile-rasterisation workers per layer.

public const int MaxTileWorkers = 8

Field Value

int

MinSkiaGpuResourceMb

Minimum / maximum accepted Skia GPU resource-cache budget, in MB (S100_SKIA_GPU_RESOURCE_MB).

public const double MinSkiaGpuResourceMb = 32

Field Value

double

MinTileBudgetMb

Minimum / maximum accepted per-layer hot-cache native budget, in MB.

public const double MinTileBudgetMb = 4

Field Value

double

MinTileDiskMb

Minimum / maximum accepted warm disk-cache budget, in MB.

public const double MinTileDiskMb = 16

Field Value

double

MinTileGpuBudgetMb

Minimum / maximum accepted per-layer GPU-residency budget, in MB.

public const double MinTileGpuBudgetMb = 4

Field Value

double

MinTileGutterDip

Minimum / maximum accepted tiled-base-plane gutter, in DIP.

public const double MinTileGutterDip = 0

Field Value

double

MinTileWorkers

Minimum / maximum accepted concurrent tile-rasterisation workers per layer.

public const int MinTileWorkers = 1

Field Value

int

Properties

Profile

The selected performance profile. Auto (the default) derives a tier from detected cores + RAM. Setting a profile recomputes any tile budget / worker default that is not pinned by an env var or a prior explicit slider value, so a constrained host can be tuned up or a workstation tuned down. Applies to the next dataset reload.

public static PerformanceProfile Profile { get; set; }

Property Value

PerformanceProfile

ProfileEnvExplicit

True when Profile is pinned by an explicit environment variable.

public static bool ProfileEnvExplicit { get; }

Property Value

bool

ResolvedProfile

The concrete tier Profile resolves to on this host.

public static PerformanceProfile ResolvedProfile { get; }

Property Value

PerformanceProfile

SceneMode

Selects the base-plane scene mode: the Tiled Phase-2 tiled base plane (default) or the Single Phase-1 single-surface arm. Seeded from S100_VECTOR_SCENE_MODE (single selects Phase 1). Read at layer build time, so a change re-applies on the next re-render.

public static VectorSceneMode SceneMode { get; set; }

Property Value

VectorSceneMode

SceneModeEnvExplicit

True when SceneMode is pinned by an explicit environment variable.

public static bool SceneModeEnvExplicit { get; }

Property Value

bool

SkiaGpuResourceMb

Budget, in MB, for the host GPU context's resource cache — the cache Skia keeps uploaded textures in, including the textures for the raster tiles the compositor blits every frame. Seeded from S100_SKIA_GPU_RESOURCE_MB (default SkiaGpuResourceMb(PerformanceProfile)) and read by a host when it creates its GPU context, so it is start-up only. When the visible tiles of every drawing layer do not fit, Skia evicts and re-uploads them on every frame; Avalonia's own default (about 28 MB) holds only a couple of dozen retina tiles.

public static double SkiaGpuResourceMb { get; }

Property Value

double

TileBudgetMb

Per-layer hot-cache native budget, in MB, for the tiled base plane. Seeded from S100_VECTOR_TILE_BUDGET_MB (default DefaultTileBudgetMb). The cache capacity is captured when a layer's tile state is first created, so a change applies on the next dataset reload (restart-only in practice).

public static double TileBudgetMb { get; set; }

Property Value

double

TileBudgetMbEnvExplicit

True when TileBudgetMb is pinned by an explicit environment variable.

public static bool TileBudgetMbEnvExplicit { get; }

Property Value

bool

TileCrossBandPrewarmEnabled

Whether idle cross-band pre-warm (issue #428) is enabled: when the tiled base plane is otherwise idle (no cold visible misses and cache headroom to spare) the renderer speculatively rasterises the band ± 1 tiles covering the current viewport, so a subsequent zoom starts warm. Seeded from S100_VECTOR_TILE_XBAND; the seed default is on, except off on the LowEnd tier (and re-forced off whenever the profile switches to LowEnd — see ApplyProfile(PerformanceProfile)), where the extra speculative raster/cache pressure is not worth it on a constrained host. That LowEnd rule governs the default only: an explicit opt-in — env var or this setter (e.g. the viewer toggle) — is still honoured on any tier, exactly like TilePredictionEnabled. Read every frame, so a change takes effect live. Independent of TilePredictionEnabled (same-band halo/fan warm set), but drained at a strictly lower worker priority than it.

public static bool TileCrossBandPrewarmEnabled { get; set; }

Property Value

bool

TileCrossBandPrewarmEnvExplicit

True when TileCrossBandPrewarmEnabled is pinned by an explicit environment variable.

public static bool TileCrossBandPrewarmEnvExplicit { get; }

Property Value

bool

TileDiskCacheEnabled

Whether the persistent warm disk tile cache (Phase 4) is enabled. Seeded from S100_VECTOR_TILE_DISK (default on). The shared disk cache is created once per process, so a change applies on restart.

public static bool TileDiskCacheEnabled { get; set; }

Property Value

bool

TileDiskCacheEnvExplicit

True when TileDiskCacheEnabled is pinned by an explicit environment variable.

public static bool TileDiskCacheEnvExplicit { get; }

Property Value

bool

TileDiskDirectory

Optional override directory for the warm disk tile cache, seeded from S100_VECTOR_TILE_DISK_DIR. null uses an OS-temp subdirectory. Read once when the disk cache is created (restart-only); not surfaced as an interactive control. The host may assign it at startup (e.g. to re-root the cache under a --data-dir folder); an explicit environment variable always wins.

public static string? TileDiskDirectory { get; set; }

Property Value

string

TileDiskDirectoryEnvExplicit

True when TileDiskDirectory is pinned by an explicit environment variable.

public static bool TileDiskDirectoryEnvExplicit { get; }

Property Value

bool

TileDiskMb

Warm disk tile-cache budget, in MB. Seeded from S100_VECTOR_TILE_DISK_MB (default DefaultTileDiskMb). Read when the shared disk cache is created (once per process), so a change applies on restart.

public static double TileDiskMb { get; set; }

Property Value

double

TileDiskMbEnvExplicit

True when TileDiskMb is pinned by an explicit environment variable.

public static bool TileDiskMbEnvExplicit { get; }

Property Value

bool

TileGpuBudgetMb

Per-layer GPU-residency budget, in MB. Seeded from S100_VECTOR_TILE_GPU_MB (default DefaultTileGpuBudgetMb). The resident-texture cache is sized when first created, so a change applies on the next dataset reload (restart-only in practice).

public static double TileGpuBudgetMb { get; set; }

Property Value

double

TileGpuBudgetMbEnvExplicit

True when TileGpuBudgetMb is pinned by an explicit environment variable.

public static bool TileGpuBudgetMbEnvExplicit { get; }

Property Value

bool

TileGpuResidencyEnabled

Whether GPU texture residency (Phase 5) is enabled for the tiled base plane. Seeded from S100_VECTOR_TILE_GPU (default off). Read every frame, so a change takes effect live (inert on a software surface).

public static bool TileGpuResidencyEnabled { get; set; }

Property Value

bool

TileGpuResidencyEnvExplicit

True when TileGpuResidencyEnabled is pinned by an explicit environment variable.

public static bool TileGpuResidencyEnvExplicit { get; }

Property Value

bool

TileGutterDip

Gutter, in DIP, rasterised beyond each tiled-base-plane tile's bounds so strokes crossing a tile seam keep their joins/caps. Seeded from S100_VECTOR_TILE_GUTTER (default DefaultTileGutterDip). Read when a tile is rasterised; only newly-rasterised tiles pick up a change (existing cached tiles keep their gutter until evicted), so a live change is best paired with a dataset reload.

public static double TileGutterDip { get; set; }

Property Value

double

TileGutterDipEnvExplicit

True when TileGutterDip is pinned by an explicit environment variable.

public static bool TileGutterDipEnvExplicit { get; }

Property Value

bool

TileMetatileEnabled

Whether adjacent tile misses may be rasterised as one 2×2 metatile job and sliced back into tile-granular cache entries (issue #427). Seeded from S100_VECTOR_TILE_METATILE; default off until the real-corpus performance gate demonstrates a measurable gain. Read for each worker job, so a change takes effect without rebuilding a dataset.

public static bool TileMetatileEnabled { get; set; }

Property Value

bool

TileMetatileEnvExplicit

True when TileMetatileEnabled is pinned by an explicit environment variable.

public static bool TileMetatileEnvExplicit { get; }

Property Value

bool

TilePredictionEnabled

Whether speculative prediction / pre-warm (Phase 3) is enabled for the tiled base plane. Seeded from S100_VECTOR_TILE_PREDICT (default on). Read every frame, so a change takes effect live.

public static bool TilePredictionEnabled { get; set; }

Property Value

bool

TilePredictionEnvExplicit

True when TilePredictionEnabled is pinned by an explicit environment variable.

public static bool TilePredictionEnvExplicit { get; }

Property Value

bool

TileWorkerCount

Number of concurrent tile-rasterisation workers per layer (S100_VECTOR_TILE_WORKERS, default TileWorkers(PerformanceProfile)). Multiple workers drain the visible-miss queue in parallel so a cold pan's tiles no longer rasterise strictly one at a time. The count is captured when a layer first starts producing tiles, so a change applies on the next dataset reload. Clamped to MinTileWorkers..MaxTileWorkers.

public static int TileWorkerCount { get; set; }

Property Value

int

TileWorkerCountEnvExplicit

True when TileWorkerCount is pinned by an explicit environment variable.

public static bool TileWorkerCountEnvExplicit { get; }

Property Value

bool