OpenRA/OpenRA — pull request #5751 by RoosterDragon (2014-06-26 23:03:21+00:00)
Title: Cache tileset lookup in Map

The lookup accounts for ~50-60% of the time spent in GetTerrainIndex and GetTerrainInfo, and these methods themselves can account for up to 1.3% of total CPU used (during a replay, so admittedly this would be higher than otherwise since there's not as much other work going on during replays). Overall this is a small but measurable win.

This is slightly dangerous since Tileset is a mutable public field but it's used by FieldLoader so I can't safely wrap this up in a property or anything.