![]() So, here it goes – an infographics which should help to estimate costs of certain operations in CPU clocks cycles – and answer the questions such as “hey, how much L2 read usually costs?”. However, sometimes it makes sense just to know ballpark numbers for relative costs of some popular operations, so you won’t do grossly inefficient things from the very beginning (and hopefully won’t need to profile the program later □ ). Herb Sutter, Andrei Alexandrescu -Whenever we need to optimise the code, we should profile it, plain and simple. This is not premature optimization it is avoiding gratuitous pessimization. ![]() Premature Pessimization Easy on yourself, easy on the code: All other things being equal, notably code complexity and readability, certain efficient design patterns and coding idioms should just flow naturally from your fingertips and are no harder to write than the pessimized alternatives.
0 Comments
Leave a Reply. |