you can regard it as optimalisation of any fabrication process. if the computer was human, you can give him only so much work that he can handle. if you give him more, he will work slowly and stutter, maybe even refuse to communicate how busy he is.
inexperienced/lazy/notgivinglefffuuu programmers give the computer too much work. optimalization is a process where you identify the work that can not be done, or that can be done in parallel or reduce other resources usage (like memory). and then you change code correspondingly.
there are lot of means to do that: threads, vectorization, change of algorithm, numeric approximations, better usage of cache, smaller memory footprint… anything to give a break to the overworked guy
basically: + – × is cheap, everything else is expensive ( / sin cos sqrt..) to very expensive (memory allocation, access). you try to be as frugal as you can be.
Latest Answers