[OT] Bit twiddling homework

Grant Edwards grant.b.edwards at gmail.com
Fri Jul 20 11:14:37 EDT 2018


On 2018-07-20, Dennis Lee Bieber <wlfraed at ix.netcom.com> wrote:

> While I suspect Python isn't micro-optimizing, take into account
> that most processors do have an "increment"/"decrement" operation --
> since that is done so much at the low-level. Also, just general
> integer addition is common, so the hardware may be optimized for
> doing them fast. Boolean operations may not be as well optimized.

Boolean operations are also very common at the lowest level, and they
involve far simpler logic than does addition.  I refuse to believe
there's an extant processor in common use where an ADD is faster than
an OR unless somebody shows me the processor spec sheet.

-- 
Grant Edwards               grant.b.edwards        Yow! These PRESERVES should
                                  at               be FORCE-FED to PENTAGON
                              gmail.com            OFFICIALS!!




More information about the Python-list mailing list