an energy based framework is disclosed that allows a software compiler or developer to make decisions between performance and energy consumption . in one aspect , a first program code may alternatively be compiled into a second program code . using measurements obtained from a processor for which the first and second program codes are being compiled , and the expected size of the data and a number of iterations , a comparison can be made between the expected energy consumption profile of the first program code and the equivalent second program code . based on the comparison , a software developer or the compiler can choose the program code that minimizes energy consumption .