Skip to content
Isthimius edited this page Jun 22, 2026 · 1 revision

Gondwana already gives you a lot of leverage if you follow its intended model.

The biggest performance win is simple: preserve the dirty-region model whenever possible.


Good performance habits

  • prefer small targeted world invalidations over full-scene refreshes
  • avoid unnecessary camera or viewport churn
  • keep parallax layers cleanly separated
  • use bitmap backbuffers when dirty-region redraw is the goal
  • use GPU backbuffers when full-viewport redraw is acceptable and presentation overhead matters more

Things that force more work

These commonly trigger full refresh behavior:

  • camera motion
  • viewport resize
  • viewport zoom changes
  • layer z-order changes
  • layer parallax changes
  • layer origin changes
  • visibility toggles
  • debug overlays like grid lines or collision boxes

Watch the right metrics

If you are tuning, pay attention to:

  • how often FullRefreshNeeded is set
  • how large refresh queues get
  • how large the backbuffer dirty rectangle becomes
  • CPS/FPS sampling results

Practical advice

If performance is poor, first ask:

  1. am I invalidating too much?
  2. am I moving the camera every cycle?
  3. am I on the right backbuffer type?
  4. am I drawing too many overlays as view-level direct drawings?

Where to read next

  • Gondwana/Rendering/RefreshQueue.cs
  • Gondwana/Rendering/RenderSurfaceHost.cs
  • Gondwana/Rendering/Backbuffers/BackbufferBase.cs
  • Gondwana/Engine.cs

Clone this wiki locally