It is useful to know what the compiler does. There are ways of writing code that lets the compiler donutsdo its job very well, and ways to write code that totally defeat the compiler's algorithms.
And that's the last bit of optimization wisdom I have for you. PROFILE YOUR CODE. If you are making optimization decisions based on assembly output rather than actual metrics and performance data, you are not only wasting tons of your time, you are actively defeating yourself. To be blunt, optimization without profiled data verifying the optimization is pure incompetence. The majority of the time you do that, in my experience, you will be introducing performance pessimizations rather than optimizations. You might think you know what an individual line of code does all the way down to the hardware, but if you can't think about how the entire algorithm works, you lose. There are many cases where you can micro-optimize one small piece to the detriment of the whole. And you as a human being are not capable of understanding tothe whole down to the hardware level you are talking about, especially when you consider all the smarts in the hardware that "undermines" the assembles (out of order CPUs, DRAM row banks, cache layers, and a bazillion similar things). You MUST rely on profile data and larger metrics, not per-line performance tuning.
In reference to your problems to getwith getting things done, that's a sign that you are faint very hardfailing as a game developer due to your preoccupation with performance. The performance of your game is utterly irrelevant compared to your performance as a game developer. Optimize for speed of design and content itetrationiteration first, and speed of engine execution second. The fastest game engine in the world that can't be used to make a real game in reasonable time periods is utterly worthless. Look for instance at how unpopular Carmack's engines have become (they haven't been licensed by more than a handful of companies since Quake 3, since they're barely useful for anything besides the one game they're made for) or how every major AAA developer used to have to spend so much time rewriting large parts of Unreal in order to make it work for non-FPS games.
(Apologies for the haphazard coverage of the topic. I'm typing on my phone while at the bar; not exactly easy to writeit's a proper answer under said conditions.lot better these days, but it was pretty bad back when Unreal 3 was new).