[issue16659] Pure Python implementation of random

Alex Gaynor report at bugs.python.org
Tue Apr 16 16:31:41 CEST 2013


Alex Gaynor added the comment:

Looking at the patch (haven't actually benchmarked it), I have two concerns with respect to performance:

a) The need for locking, this doesn't exist in the C or RPython versions because of the GIL. That locking is going to be distinctly un-free.
b) The need for manually masking overflowing arithmetic (yes I know, everything is a long, but just looking at it algorithmically, we really want the 2s complement).

I don't have an opinion about how to solve either of these, but without a solution I doubt performance will ever be competitive. I think it would be a mistake to assume these issues are specific to this patch, they strike me as generally applicable issues.

----------

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


More information about the Python-bugs-list mailing list