dictionary speed

simonb at webone.com.au simonb at webone.com.au
Fri Jul 13 06:03:43 CEST 2001


there doesnt seem to be any answer to this question.
makes me wonder if it is a question in the first place.
Try running some tests using the structures you are interested in.
If thats too hard then post some code so we know
what you are talking about.
that said, i don't think you should worry about
nesting dictionaries. They are rather
hearty beasts and would probably warm to the task nicely.
It's only pointer traversal; ever programed in c?
ie. a dictionary access n levels deep would incur
time penalty proportional to n times the penalty
due to each dictionary look up (log n i presume).

:)
Simon


doug s. wrote:

>hi all,
>
>is there any speed differential to be aware or with nested
>dictionaries? that is, does the position of data matter. for example,
>if i need to access certain data quickly and often, is it best to
>structure things so that it is all near the top level?
>
>thanks,
>doug
>




More information about the Python-list mailing list