joligario
07-25-2009, 03:46 AM
Looking at a few things with the EMU and PEQ database and had a question.
Which way would be faster if there is much difference? Assuming that about 1000 entries are read in from the database and 20% of the entries are larger than 256.
heading = db.heading;
if heading > 256 { heading = heading % 256; }
or
heading = db.heading % 256;
My initial assumption is that the if statement would require more processor use if that remains 20%. Now, if that is the difference, what if I were to reduce the entries to 0% larger than 256. Would that change the processor use in either direction?
Which way would be faster if there is much difference? Assuming that about 1000 entries are read in from the database and 20% of the entries are larger than 256.
heading = db.heading;
if heading > 256 { heading = heading % 256; }
or
heading = db.heading % 256;
My initial assumption is that the if statement would require more processor use if that remains 20%. Now, if that is the difference, what if I were to reduce the entries to 0% larger than 256. Would that change the processor use in either direction?