Skip to content

Conversation

@Arufonsu
Copy link
Contributor

@Arufonsu Arufonsu commented Jan 7, 2026

[Editor]

  • We were iterating over the same 9 maps (3x3 grid) 6 separate times for different layers/attributes. This fix consolidates the whole thing into a single pass.
  • Add DrawAllMapAttributes() to consolidate 3 attribute draw calls
  • Cached property lookups in DrawGridOverlay, DrawTransparentBorders, and DrawMapBorders to avoid repeated access
  • Cache textures and property lookups in hot paths
  • Move DrawMapGrid lines outside nested loop, reduction in draw calls
  • Reduce DrawMapBorders from 8 to 4 calls, pre-calculates values
  • Optimized DrawTransparentBorders with texture caching and IsDisposed check
  • Add view culling to skip off-screen rendering
  • Removes unused imports and variables.

Before:

2026-01-31.21-04-47.mp4

After:

2026-02-07.20-51-48.1.mp4
{67814741-5E5B-4896-A1C3-9E38EF56603A} {FA976E53-EFDA-4F27-BCF5-0A5A5BD0C6C8} {BB229254-A4E5-4099-AE5E-FC57B8BAECC0} {0C08205C-60D1-4C14-AB22-A1484980F049} {65C82D90-0D46-4FC2-98A9-85085A2A8398}

@Arufonsu Arufonsu requested review from a team January 7, 2026 00:50
@Arufonsu Arufonsu added performance Performance optimization chore Cleans up code, documentation or project structure without altering functionality labels Jan 7, 2026
@Arufonsu Arufonsu changed the title Performance: Editor's Redundant Map Rendering performance: Editor's Redundant Map Rendering Jan 17, 2026
[Editor]
- We were iterating over the same 9 maps (3x3 grid) 6 separate times for different layers/attributes. This fix consolidates the whole thing into a single pass.
- Add DrawAllMapAttributes() to consolidate 3 attribute draw calls
- Cached property lookups in DrawGridOverlay, DrawTransparentBorders, and DrawMapBorders to avoid repeated access
- Cache textures and property lookups in hot paths
- Move DrawMapGrid lines outside nested loop, reduction in draw calls
- Reduce DrawMapBorders from 8 to 4 calls, pre-calculates values
- Optimized DrawTransparentBorders with texture caching and IsDisposed check
- Add view culling to skip off-screen rendering
- Removes unused imports and variables.

Signed-off-by: Arufonsu <17498701+Arufonsu@users.noreply.github.com>
@Arufonsu Arufonsu force-pushed the performance/editor-map-rendering branch from 0bb5ad2 to 0cbf1b2 Compare February 7, 2026 23:50
@Arufonsu Arufonsu requested a review from pandinocoder February 7, 2026 23:59
@Arufonsu Arufonsu changed the title performance: Editor's Redundant Map Rendering performance: editor's map and grid rendering Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Cleans up code, documentation or project structure without altering functionality performance Performance optimization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant