Make Your Match-3 Feel Better With One Small Change!

By Fuat Can Koseoglu,

Your board feels smooth in the editor, then runs at lower frame rates on device. Why? You often copy the grid every time you look at it. Those "classic" helpers run for every scan: Allocate a new Tile[] Copy 8 elements into it Return the clone Do the same for columns and you double the allocations. Run that per frame, per cascade, per hint check, and the allocator often never rests. What changed in my zero-copy version? Store the grid in a flat Tile[] GetRow(y) returns _grid.AsSpan(offset, width) Column scans walk _grid[i * width + x] directly No buffers, no copying, no temporary garbage Span is not magic. The magic is reusing the memory you already own. Span just hands you a safe window into it. Where people still waste memory: Flood-fill helpers that build new lists each step Power-up logic that copies 3x3 blocks Shuffle validators that snapshot the board over and over Input handlers that materialize neighbors for every swap Fix pattern: preallocate once, then slice. Remember: less garbage collected = fewer dropped frames when the candy starts falling