Skip to content
This repository was archived by the owner on Jan 27, 2022. It is now read-only.

Bas Westerbaan's suggested speed improvement for random.shuffle.#83

Closed
mitchellrj wants to merge 1 commit into
pycrypto:masterfrom
mitchellrj:faster-shuffle-1171237
Closed

Bas Westerbaan's suggested speed improvement for random.shuffle.#83
mitchellrj wants to merge 1 commit into
pycrypto:masterfrom
mitchellrj:faster-shuffle-1171237

Conversation

@mitchellrj

Copy link
Copy Markdown
Contributor

@dlitz

dlitz commented Jun 23, 2014

Copy link
Copy Markdown
Member

Rejecting this for now. See my comment on the commit. The suggested routine performs well on small inputs, but completely falls apart on the computation of math.factorial(len(x)) with even a moderate-sized list (e.g. a million entries). I worry that if I merged this, it would introduce a DoS vulnerability.

randrange() should just be faster.

@dlitz dlitz closed this Jun 23, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants