Design Patterns summarize the common solutions for particular problems. Book "Gang Of Four Design Pattern" is classic. Book "Game programming pattern" shows solutions to a variety of game related problems. Here, I will summarize the optimization patterns I used often, mainly in the game of ArmaGallant and a recent mobile game. Both work is carried on in Unity C#. Optimize Pattern 1-----Cache the result, compute once, retrieve later string operation often generate gc, for example, int.tostring(). to avoid gc, can cache the result in a dictionary. Cache result for int.tostring Cache result for string.split(':') Double key-cache result of str1 + "." + str2 or str1+str2 Dictionary<string, Dictionary<string, string>> Notice, do not cache too many things to explode the memory. Optimization Pattern 2---Temporary parameter for an object 2.1 find common set of two sets. Given problem: when you have two sets of same type objects, ...