On 10.12.12 09:48, Christian Heimes wrote:
On the other hand every lookup and collision checks needs an additional
multiplication, addition and pointer dereferencing:
entry = entries_baseaddr + sizeof(PyDictKeyEntry) * idx
I think that main slowdown will be in getting index from array with
variable size of elements. It requires conditional jump which is not
such cheap as additional or shifting.
switch (self->index_size) {
case 1: idx = ((uint8_t *)self->indices)[i]; break;
case 2: idx = ((uint16_t *)self->indices)[i]; break;
...
}
I think that variable-size indices don't worth effort.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com