A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-June/004761.html below:

[Python-Dev] talking about performance... [case closed]

[Python-Dev] talking about performance... [case closed] [Python-Dev] talking about performance... [case closed]Daniel Berlin dan@cgsoftware.com
Tue, 20 Jun 2000 09:55:11 -0700 (PDT)
> So the intent of the code is to avoid the expense of calling memcmp if a
> full n-character memcmp can't possibly find equality at i (due to mismatch
> of first characters), and the assumption is that first characters mismatch
> frequently.  Both seem like good calls to me!

However, smart compilers (gcc 2.95+ fer instance) will produce an inline
memcmp call that is faster, and has no overhead (IE it's not making a
library call).
Thus, the first character mismatch test is useless.
We had the same thing in strcmp macros in GDB, where we tested the first
character, then strcmp'd.
It was faster to just strcmp, even when they *did* mismatch.

--Dan




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4