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

Replace AsByteSliceMut with Fill #940

Merged
merged 5 commits into from
Mar 9, 2020
Merged

Replace AsByteSliceMut with Fill #940

merged 5 commits into from
Mar 9, 2020

Conversation

dhardy
Copy link
Member

@dhardy dhardy commented Feb 28, 2020

Breaking: this would be the first step towards 0.8.

Note that once specialization is available, Fill becomes redundant. Until then, we need it (in some form).

Benchmark results:

test gen_1kb_u16_fill        ... bench:         325 ns/iter (+/- 20) = 3150 MB/s
test gen_1kb_u16_gen_array   ... bench:         876 ns/iter (+/- 80) = 1168 MB/s
test gen_1kb_u16_iter_repeat ... bench:       1,302 ns/iter (+/- 112) = 786 MB/s
test gen_1kb_u16_sample_iter ... bench:       1,251 ns/iter (+/- 63) = 818 MB/s
test gen_1kb_u64_fill        ... bench:         331 ns/iter (+/- 12) = 3093 MB/s
test gen_1kb_u64_gen_array   ... bench:         236 ns/iter (+/- 11) = 4338 MB/s
test gen_1kb_u64_iter_repeat ... bench:         335 ns/iter (+/- 11) = 3056 MB/s
test gen_1kb_u64_sample_iter ... bench:         330 ns/iter (+/- 8) = 3103 MB/s

Without opt:

test gen_1kb_u16_fill        ... bench:         484 ns/iter (+/- 99) = 2115 MB/s
test gen_1kb_u64_fill        ... bench:         460 ns/iter (+/- 19) = 2226 MB/s

With AsByteSliceMut:

test gen_1kb_u16_fill        ... bench:         337 ns/iter (+/- 30) = 3038 MB/s
test gen_1kb_u64_fill        ... bench:         327 ns/iter (+/- 13) = 3131 MB/s

Also, add const_generics feature flag. See also #939.

@dhardy
Copy link
Member Author

dhardy commented Feb 29, 2020

Looks like we'll have to remove even feature-gated const_generics until the MSRV is increased.

Other than that, review @vks?

@dhardy
Copy link
Member Author

dhardy commented Mar 6, 2020

I removed the const-generics impl since even behind a feature flag it was erroring out the 1.32 build. The code still lives here.

Still waiting on a review, but maybe it's time to give up on that.

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.

1 participant