This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eng793
Recipients eng793, r.david.murray, rhettinger, serhiy.storchaka
Date 2012-09-03.22:55:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1346712956.3.0.326893344799.issue15837@psf.upfronthosting.co.za>
In-reply-to
Content
The int=int still makes no difference, but if the second argument is set to random.random, we get a big speedup, regardless of whether the third argument is there:

without int=int:

amoura@amoura-laptop:~/cpython$ time ./python -c "import random; lst=list(range(1000000)); random.shuffle(lst,random.random); print (len(lst))"
1000000

real	0m7.082s
user	0m6.952s
sys	0m0.116s

With int=int:

amoura@amoura-laptop:~/cpython$ time ./python -c "import random; lst=list(range(1000000)); random.shuffle(lst,random.random); print (len(lst))"
1000000

real	0m7.281s
user	0m7.156s
sys	0m0.100s

Without second argument:

amoura@amoura-laptop:~/cpython$ time ./python -c "import random; lst=list(range(1000000)); random.shuffle(lst); print (len(lst))"
1000000

real	0m13.783s
user	0m13.609s
sys	0m0.108s

This could be because of the many tests of whether the 2nd argument is None in the loop.
History
Date User Action Args
2012-09-03 22:55:56eng793setrecipients: + eng793, rhettinger, r.david.murray, serhiy.storchaka
2012-09-03 22:55:56eng793setmessageid: <1346712956.3.0.326893344799.issue15837@psf.upfronthosting.co.za>
2012-09-03 22:55:55eng793linkissue15837 messages
2012-09-03 22:55:55eng793create