Skip to content

perf(client): quick-win settings — discrete GPU, faster quality ramp-up#28

Open
RZDESIGN wants to merge 1 commit intohytopiagg:mainfrom
RZDESIGN:perf/client-settings-quick-wins
Open

perf(client): quick-win settings — discrete GPU, faster quality ramp-up#28
RZDESIGN wants to merge 1 commit intohytopiagg:mainfrom
RZDESIGN:perf/client-settings-quick-wins

Conversation

@RZDESIGN
Copy link
Copy Markdown

@RZDESIGN RZDESIGN commented Mar 5, 2026

Summary

Three tiny tuning changes (3 lines total) that improve perceived and actual performance for a large portion of players:

1. powerPreference: 'high-performance'Renderer.ts

Most gaming laptops ship with dual GPUs (integrated + discrete). Browsers default to the power-saving integrated GPU unless the WebGL context explicitly requests otherwise. Adding powerPreference: 'high-performance' to the WebGLRenderer constructor hints the browser to prefer the discrete GPU, giving an immediate frame-rate boost on dual-GPU systems at zero runtime cost.

2. Quality warmup 10 s → 5 s — SettingsManager.ts

After joining a world, the dynamic quality auto-scaler waits a warmup period before it starts upgrading quality, to avoid reacting to the heavy initialization work. 10 seconds was overly conservative — heavy init typically settles within 2–3 seconds. Reducing this to 5 s lets players on capable hardware reach their optimal quality tier sooner, making the game feel faster to load.

3. Quality-up threshold 5 s → 3 s — SettingsManager.ts

Once the warmup is over, the scaler requires sustained high FPS before it upgrades quality. Previously it waited 5 s; reducing to 3 s still guards against up/down oscillation (the downgrade threshold remains at 3 s, and there's a separate cooldown) but lets the client converge on the right quality tier roughly 40% faster.

Changes

File Change
client/src/core/Renderer.ts Added powerPreference: 'high-performance' to WebGLRenderer options
client/src/settings/SettingsManager.ts QUALITY_ADJUSTMENT_WARMUP_TIME: 10 → 5
client/src/settings/SettingsManager.ts QUALITY_UP_TIME_THRESHOLD: 5 → 3

Risk Assessment

  • powerPreference — This is a hint, not a mandate. Browsers are free to ignore it. On single-GPU systems and desktops it's a no-op. No downside.
  • Warmup / quality-up — The downgrade path and its thresholds are untouched, so the system can still react quickly if quality was bumped too high. The cooldown between adjustments also remains unchanged, preventing oscillation.

Test Plan

  • Verify on a dual-GPU laptop (e.g. MacBook Pro with M-series, or Windows laptop with Intel + NVIDIA) that the discrete GPU is selected (check renderer.info or browser GPU internals)
  • Join a world on a mid-range machine — quality should visibly ramp up within ~8 s of the world packet instead of ~15 s
  • Join on a low-end machine — quality should still downgrade quickly and not oscillate

Three small tuning changes with outsized user-facing impact:

1. WebGLRenderer powerPreference: 'high-performance'
   On dual-GPU laptops (most gaming laptops) browsers default to the
   integrated GPU.  This hint requests the discrete GPU, giving an
   immediate frame-rate boost at zero runtime cost.

2. Quality warmup 10 s → 5 s
   After joining a world the auto-scaler waits before it begins
   upgrading quality.  10 seconds is overly conservative — 5 s is
   enough for the heavy init work to settle while letting players on
   capable hardware reach higher quality sooner.

3. Quality-up threshold 5 s → 3 s
   Once the scaler starts, it previously required 5 s of sustained
   high FPS before upgrading.  3 s still guards against oscillation
   but lets the client converge on the right quality tier roughly
   40 % faster.

Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant