Class MapMagicPerformanceTests
- Namespace
- GrindFest
- Assembly
- GrindFest.dll
Performance probes for MapMagic terrain generation. These tests pin a tile far enough from the player that it is guaranteed unloaded, then time the full Refresh → OnTileApplied roundtrip.
Wrapped in Profiler samples so a Deep Profile capture (Window → Analysis → Profiler, "Deep Profile" enabled, hit "Record") will show a breakdown per generator inside the "MapMagic:Generate Tile" marker.
Each test logs:
- wall time from Refresh() to OnTileApplied (background generation)
- wall time from OnTileApplied to next frame end (main-thread apply)
public class MapMagicPerformanceTests : DevTest
- Inheritance
-
objectMapMagicPerformanceTests
- Inherited Members
Methods
- GenerateMultipleTiles()
Generate 3 fresh tiles in different directions; logs min/max/avg. Sample size is small to keep test time bounded; bump if needed.
- GenerateSingleTile()
Generate ONE fresh tile adjacent (offset) to the hero and report timings. Use this when iterating on graph optimizations.
- GenerateSingleTileWithNodeBreakdown()
Generate ONE fresh tile and break down wall time by Generator TYPE. Hooks MapMagic.Nodes.Graph.OnAfterNodeGenerated and times the gap between successive node-completion events on each thread (MapMagic generates a single tile sequentially on one worker thread, so the gap equals the previous node's Generate() time).
Output is sorted top-down so the slowest generator types are at the top of the log — that's almost always the actual hotspot.