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

Optimize Bernoulli::new #500

Merged
merged 2 commits into from Jun 9, 2018

Conversation

pitdicker
Copy link
Contributor

A small optimization and some clean-up around Bernoulli::new. I added some comments to describe the method, and removed the useless "undefined behaviour" test because it does not apply.

Benchmarks before:

test misc_gen_bool_const             ... bench:       4,266 ns/iter (+/- 48)
test misc_gen_bool_var               ... bench:       6,239 ns/iter (+/- 63)
test misc_bernoulli_const            ... bench:       3,978 ns/iter (+/- 24)
test misc_bernoulli_var              ... bench:       6,299 ns/iter (+/- 6)

After:

test misc_gen_bool_const             ... bench:       3,990 ns/iter (+/- 12)
test misc_gen_bool_var               ... bench:       5,984 ns/iter (+/- 90)
test misc_bernoulli_const            ... bench:       3,976 ns/iter (+/- 8)
test misc_bernoulli_var              ... bench:       5,946 ns/iter (+/- 56)

@pitdicker pitdicker changed the title Optimize bernoulli new Optimize Bernoulli::new Jun 7, 2018
@pitdicker pitdicker merged commit ec3d7ef into rust-random:master Jun 9, 2018
@pitdicker pitdicker deleted the optimize_bernoulli_new branch June 9, 2018 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants