peps: c960bed22bf6 (original) (raw)

Mercurial > peps

changeset 5174:c960bed22bf6

Make Nick BDFG delegate add string length distribution add http://bugs.python.org/issue19183

Christian Heimes christian@cheimes.de
date Mon, 07 Oct 2013 15:20:25 +0200
parents 2781d7bad1d6
children 0939b63616e5
files pep-0456.txt
diffstat 1 files changed, 12 insertions(+), 0 deletions(-)[+] [-] pep-0456.txt 12

line wrap: on

line diff

--- a/pep-0456.txt +++ b/pep-0456.txt @@ -3,6 +3,7 @@ Title: Secure and interchangeable hash a Version: RevisionRevisionRevision Last-Modified: DateDateDate Author: Christian Heimes christian@python.org +BDFL-Delegate: Nick Coghlan Status: Draft Type: Standards Track Content-Type: text/x-rst @@ -461,10 +462,17 @@ speed but it is still in the same order It's yet unknown how the new distribution of hash values affects collisions of common keys in dicts of Python classes. +Typical length +-------------- + Serhiy Storchaka has shown in [issue16427]_ that a modified FNV implementation with 64 bits per cycle is able to process long strings several times faster than the current FNV implementation. +However according to statistics [issue19183]_ a typical Python program as +well as the Python test suite have a hash ratio of about 50% small strings +between 1 and 6 bytes. Only 5% of the strings are larger than 16 bytes. + Grand Unified Python Benchmark Suite ------------------------------------ @@ -526,6 +534,8 @@ versions of the PEP aim for compile time Reference ========= +* Issue 19183 [issue19183]_ contains a reference implementation. + .. [29c3] http://events.ccc.de/congress/2012/Fahrplan/events/5152.en.html[](#l1.35) .. [fnv] http://en.wikipedia.org/wiki/Fowler-Noll-Vo_hash_function[](#l1.37) @@ -544,6 +554,8 @@ Reference .. [issue16427] http://bugs.python.org/issue16427[](#l1.40) +.. [issue19183] http://bugs.python.org/issue19183[](#l1.42) + .. [trie] http://en.wikipedia.org/wiki/Trie[](#l1.44) .. [city] http://code.google.com/p/cityhash/[](#l1.46)