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 <rep...@bugs.python.org>
<http://bugs.python.org/issue18511>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to