??? 07/06/05 17:11 Read: times |
#96706 - Micro-Optimisations - real-life example Responding to: ???'s previous message |
Erik Malund said:
The discussion is not about 'micro optimisations' which, in the best case, will save a cycle or two, but about habits that will save "save a cycle or two" in hundereds of places. Real example: I had to port some supposedly-portable "reference code" to an 8051. I got it all to compiler and run. Then I noticed that one particular variable was referencesd very frequently all over the place; moving that one variable (probably just a char, but might've been an int - I don't remember now) from XDATA to DATA resulted in saving several K on the overall code size! "Micro optimisation?" maybe - but repeated so often to cause a macroscopic benefit! |