Choosing between sampling and instrumental profilers depends on what you’re trying to optimize. Unity Profiler gives precise timing data but adds overhead, making it great for tracking spikes and slow scripts. Sampling profilers like Superluminal are better for finding CPU hotspots and analyzing multi-threading with minimal impact. What is the best approach?
Let’s see if the latest .NET version changes the results of my old post on Array vs Dictionary lookup performance in C#
We were taught about data structures that a Dictionary has O(1) lookup and the linear search in an unsorted array is O(n). So based on this we can assume that when we need frequent access by a key we should use a Dictionary, right?
Well, not quite always.