Herman Schonfeld wrote in a message to Darin McBride:
NJ> //Screen[x+y*320] = color;
NJ> Screen[x+(y<<6)+(y<<8)] = color; /* same as above but here the
NJ> multiplication is replaced with
NJ> shifts to make it faster */
DM>Are you SURE that two shift operations followed by an addition is really
DM>faster than the hardware-optimized integer multiplication?
DM>Perhaps on an 8086... but on an 80486? Probably not...
HS> Bit shifting will ALWAYS be faster than multiplying.
According to a book I am reading right now. Bit shifting is faster by a
factor of around 3 times. You just have to be careful if you shift too far
you may lose significant bits. :-(
Mike....
--- timEd 1.10+
---------------
* Origin: Arcadia [New Westminster, BC] (1:153/831.4)
|