Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

faster rand! for Dict, Set, BitSet #24866

Merged
merged 2 commits into from
Dec 4, 2017
Merged

Conversation

rfourquet
Copy link
Member

This is by factoring out some computations, which is made easier by the Sampler framework.

This should (more than) compensate for the small performance regressions observed in #23964.

@rfourquet rfourquet added performance Must go faster randomness Random number generation and the Random stdlib labels Nov 30, 2017
@rfourquet
Copy link
Member Author

@nanosoldier runbenchmarks("random", vs=":master")

@rfourquet
Copy link
Member Author

While I was at it, I implemented also the improvement mentioned in the third bullet of #23964 (comment).

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan

This is by factoring out some computations, which is made easier by the `Sampler` framework.
For generating few characters from a string `str`, it's more efficient
to use `Sampler(rng, str, Val(1))` rather than with `Val(Inf)`.
This change improves this use case, e.g.:

sp = Sampler(rng, str, Val(1);
C = (rand(rng, sp), rand(rng, sp), rand(rng, sp))
@rfourquet rfourquet force-pushed the rf/rand/faster-dict-set branch from 007b640 to 199073a Compare December 3, 2017 10:44
@rfourquet rfourquet merged commit c979996 into master Dec 4, 2017
@rfourquet rfourquet deleted the rf/rand/faster-dict-set branch December 4, 2017 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster randomness Random number generation and the Random stdlib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants