Skip to content

performance: editor's graphics#2797

Open
Arufonsu wants to merge 1 commit intomainfrom
performance/editor-map-rendering
Open

performance: editor's graphics#2797
Arufonsu wants to merge 1 commit intomainfrom
performance/editor-map-rendering

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
  • 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
@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
@Arufonsu Arufonsu force-pushed the performance/editor-map-rendering branch 2 times, most recently from 7272759 to 48a99eb Compare February 21, 2026 22:03
@Arufonsu Arufonsu requested a review from pandinocoder March 1, 2026 00:58
@Arufonsu
Copy link
Contributor Author

Arufonsu commented Mar 1, 2026

Hopefully solves #2740
{E26507D1-CE37-49AA-AF42-74B740CDE4FD}

@Arufonsu Arufonsu linked an issue Mar 1, 2026 that may be closed by this pull request
2 tasks
@Arufonsu Arufonsu requested review from a team March 1, 2026 02:32
@Arufonsu Arufonsu force-pushed the performance/editor-map-rendering branch 3 times, most recently from 0324942 to 0d50a97 Compare March 1, 2026 02:45
[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
- 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.

- panda's review (I)

Signed-off-by: Arufonsu <17498701+Arufonsu@users.noreply.github.com>
@Arufonsu Arufonsu changed the title performance: editor's map and grid rendering performance: editor's graphics Mar 1, 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.

bug: Map preview stops working after 2K(?)+ maps

2 participants