[issue14621] Hash function is not randomized properly

Giovanni Bajo report at bugs.python.org
Wed Jan 2 19:56:26 CET 2013


Giovanni Bajo added the comment:

Il giorno 02/gen/2013, alle ore 19:51, Christian Heimes <report at bugs.python.org> ha scritto:

> 
> Christian Heimes added the comment:
> 
> Giovanni, why do you think that hashing of unicode strings is slower than byte strings? 
> 
> First of all ASCII only unicode strings are packed and use just one byte per char. CPython's FNV implementation processes one element in each cycle, that is one byte for bytes and ASCII unicode, two bytes for UCS-2 and four bytes for UCS-4. Bytes and UCS-4 strings require the same amount of CPU instructions.

Ah sorry, I stand corrected (though packing wasn't there in 3.0, was it? I was specifically referred to the 2.x -> 3.0 transition).
-- 
Giovanni Bajo

My Blog: http://giovanni.bajo.it

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14621>
_______________________________________


More information about the Python-bugs-list mailing list