Python: best dictionary implementation

I have several python scripts where I store 5-10 million pairs of key values ​​in a dictionary, and I request this dictionary about 5-10 million times. I noticed that the python dict does not work very well. Is there any other implementation that is most suitable for string keys.

Edit:

I have two large lists of people’s names and I want to match them, so I take one of them as a list of links and try to apply different heuristics for each name in the second list, to find out if this exists in the first list, So, I should query the first list 2-3 times for each name in the second list. Hope this makes sense.

+5
source share
6 answers

. () , .

, . ? , "" .

, ?

+1

: ? , , ? , ?

10 100 - . 2 , 2 , 32- WinXP.

, ( 10 2) , .

+1

, , .

, Redis: http://redis.io. .

python .

0
0

, :

set(names1).intersection(set(names2))

Right?

, , , , - Python.

0

Even if you are not using class or method calls, put your code in a function and call that function. Python functions are highly optimized in part because it accesses local variables faster than global variables.

Python performance tips written on the Python wiki read well in this thread.

0
source

All Articles