[New-bugs-announce] [issue18511] random.shuffle could be faster

Wes Turner report at bugs.python.org
Sat Jul 20 02:34:04 CEST 2013


New submission from Wes Turner:

random.shuffle [1][2] could be faster. 

``xrange(10,1,-1)`` is faster than ``reversed(xrange(1,10))``.

[1] http://hg.python.org/cpython/file/v3.3.2/Lib/random.py#l254
[2] http://hg.python.org/cpython/file/v2.7.5/Lib/random.py#l276

----------
components: Library (Lib)
files: random-shuffle_v2.7.5_timeit.py
messages: 193388
nosy: westurner
priority: normal
severity: normal
status: open
title: random.shuffle could be faster
type: performance
versions: 3rd party, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file30983/random-shuffle_v2.7.5_timeit.py

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


More information about the New-bugs-announce mailing list