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/2012-December/123038.html below:

[Python-Dev] More compact dictionaries with faster iteration

[Python-Dev] More compact dictionaries with faster iteration [Python-Dev] More compact dictionaries with faster iterationSerhiy Storchaka storchaka at gmail.com
Mon Dec 10 10:12:27 CET 2012
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.


More information about the Python-Dev mailing list

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