New submission from paul rubin <[EMAIL PROTECTED]>:

This is observed in Python 2.5.1, I haven't tried any later versions.

d = collections.deque(xrange(100000))
random.shuffle(d)

is quite slow.  Increasing the size to 200k, 300k, etc. shows that the
runtime increases quadratically or worse.  It's much faster to convert
the deque to a list, shuffle the list, and make a new deque from the
shuffled list.

----------
components: Library (Lib)
messages: 74773
nosy: phr
severity: normal
status: open
title: random.shuffle slow on deque
versions: Python 2.5

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4123>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to