Avoid LINQ in High-Frequency Game Code
Standard LINQ extensions (.Where(), .Select(), .Any()) generate intermediate allocations on the heap that trigger garbage collection.
The Tip: Standard LINQ extensions (.Where(), .Select(), .Any()) generate intermediate allocations on the heap that trigger garbage collection.
How to Use: Use standard for or foreach loops over arrays or preallocated lists inside gameplay logic and update loops.

Article complete?
20 XP lands automatically when you reach the end, and it counts toward today's quests.
Next level
Shader Graph Basics for 2D GamesGame Dev Articles · 1 min · +20 XPRate this article
Comments
Comments are held for moderation before appearing publicly.