diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-06-02 05:27:19 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-06-02 05:27:19 (GMT) |
commit | eb28ef209eb0ce0b0975ee91331d02652ee3c41c (patch) | |
tree | 4d9e41dccf40e06f46ac2be9e3f12947b810e126 /Misc | |
parent | 951a8841d15ca9ba489641a67faa446f3264405f (diff) | |
download | cpython-eb28ef209eb0ce0b0975ee91331d02652ee3c41c.zip cpython-eb28ef209eb0ce0b0975ee91331d02652ee3c41c.tar.gz cpython-eb28ef209eb0ce0b0975ee91331d02652ee3c41c.tar.bz2 |
New collision resolution scheme: no polynomials, simpler, faster, less
code, less memory. Tests have uncovered no drawbacks. Christian and
Vladimir are the other two people who have burned many brain cells on the
dict code in recent years, and they like the approach too, so I'm checking
it in without further ado.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -15,7 +15,7 @@ Core To enhance the usability of the .encode() method, the special casing of Unicode object return values was dropped (Unicode objects were auto-magically converted to string using the default encoding). - + Both methods will now return whatever the codec in charge of the requested encoding returns as object, e.g. Unicode codecs will return Unicode objects when decoding is requested ("äöü".decode("latin-1") @@ -116,13 +116,11 @@ Core to crash if the element comparison routines for the dict keys and/or values mutated the dicts. Making the code bulletproof slowed it down. -- Collisions in dicts now use polynomial division instead of multiplication - to generate the probe sequence, following an idea of Christian Tismer's. - This allows all bits of the hash code to come into play. It should have - little or no effect on speed in ordinary cases, but can help dramatically - in bad cases. For example, looking up every key in a dict d with - d.keys() = [i << 16 for i in range(20000)] is approximately 500x faster - now. +- Collisions in dicts are resolved via a new approach, which can help + dramatically in bad cases. For example, looking up every key in a dict + d with d.keys() = [i << 16 for i in range(20000)] is approximately 500x + faster now. Thanks to Christian Tismer for pointing out the cause and + the nature of an effective cure (last December! better late than never). Library |