Efficiency of lists vs tag searches

Again, there’s only one way to answer performance questions and that is by attaching the profiler.

And performance is NEVER the only consideration. Readability and code flexibility is important too, and optimizations generally destroy readability and flexibility.

My standard blurb for people poised on the edge of destroying their codebases irrevocably:

DO NOT OPTIMIZE CODE JUST BECAUSE… If you don’t have a problem, DO NOT OPTIMIZE!

If you DO have a problem, always start by using the profiler:

Window → Analysis → Profiler

Failure to use the profiler means you’re just guessing, making a mess of your code for no good reason.

Notes on optimizing UnityEngine.UI setups:

2 Likes