[issue29304] dict: simplify lookup functions

INADA Naoki report at bugs.python.org
Mon Jun 26 09:19:50 EDT 2017


INADA Naoki added the comment:

Antonie:

Thank you for you comment.
Actually speaking, size of instructions are reduced on amd64 at gcc.

lookdict_unicode_nodummy and lookdict_split doesn't have any reason to have duplicated code anymore.  I'll do dedupe for them first.

lookdict and lookdict_unicode have one difference between code before loop and inner loop:

// before loop:
    if (ix == DKIX_DUMMY) {
        freeslot = i;

// inner loop:
        if (ix == DKIX_DUMMY) {
            if (freeslot == -1)
                freeslot = i;

Since lookdict_unicode may be used for namespace, I'll keep it for now.
But lookdict() is very unlikely to be used for namespace.  I'll dedupe it after checking some macro/micro benchmarks.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29304>
_______________________________________


More information about the Python-bugs-list mailing list