I’m going to have 1 small dictionary (between 5 and 20 keys) that will be referenced up to a hundred times or so for one page load in python 2.5.
I’m starting to name the keys which it will be looking up and I was wondering if there is a key naming convention I could follow to help dict lookup times.
I had to test 😉
using
1"one""aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"as one of the keys into a dictionary of length 4. Iterating 10,000,000 times and measuring the times. I get this result:
I.e no difference…
My code