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

use read_u16 and fix clippy warnings #3

Merged
merged 1 commit into from
Sep 30, 2019
Merged

Conversation

cristicbz
Copy link
Contributor

@cristicbz cristicbz commented Dec 21, 2017

This PR adds a read_u16 step for write-s, which speeds up the small string case a little bit (see benchmarks below). It also replaces the 32-bit seed with the one from rustc, rather than using than using the last 32bits of the 64bit one.

It also fixes all clippy warnings:

  • FireFox -> Firefox (correct capitalisation)
  • u32::from and u64::from instead of as casts for lossless conversions.
  • use separators for the seeds to make them easier to read.

Thanks for the crate and let me know if I haven't conformed to style guidelines or anything else!

Benchmarks
fx32 before:

test bench_fx32_003    ... bench:           2 ns/iter (+/- 0)
test bench_fx32_004    ... bench:           2 ns/iter (+/- 0)
test bench_fx32_011    ... bench:           5 ns/iter (+/- 0)
test bench_fx32_012    ... bench:           3 ns/iter (+/- 0)
test bench_fx32_023    ... bench:           6 ns/iter (+/- 0)
test bench_fx32_024    ... bench:           5 ns/iter (+/- 0)
test bench_fx32_068    ... bench:          14 ns/iter (+/- 0)
test bench_fx32_132    ... bench:          37 ns/iter (+/- 4)


fx32 after:

test bench_fx32_003    ... bench:           2 ns/iter (+/- 0)
test bench_fx32_004    ... bench:           2 ns/iter (+/- 0)
test bench_fx32_011    ... bench:           3 ns/iter (+/- 0)
test bench_fx32_012    ... bench:           3 ns/iter (+/- 0)
test bench_fx32_023    ... bench:           5 ns/iter (+/- 0)
test bench_fx32_024    ... bench:           5 ns/iter (+/- 0)
test bench_fx32_068    ... bench:          14 ns/iter (+/- 0)
test bench_fx32_132    ... bench:          35 ns/iter (+/- 1)


fx64 before:
test bench_fx64_003    ... bench:           3 ns/iter (+/- 0)
test bench_fx64_004    ... bench:           1 ns/iter (+/- 0)
test bench_fx64_011    ... bench:           4 ns/iter (+/- 0)
test bench_fx64_012    ... bench:           2 ns/iter (+/- 0)
test bench_fx64_023    ... bench:           5 ns/iter (+/- 0)
test bench_fx64_024    ... bench:           3 ns/iter (+/- 0)
test bench_fx64_068    ... bench:           7 ns/iter (+/- 0)
test bench_fx64_132    ... bench:          15 ns/iter (+/- 0)

fx64 after:
test bench_fx64_003    ... bench:           2 ns/iter (+/- 0)
test bench_fx64_004    ... bench:           1 ns/iter (+/- 0)
test bench_fx64_011    ... bench:           3 ns/iter (+/- 0)
test bench_fx64_012    ... bench:           3 ns/iter (+/- 0)
test bench_fx64_023    ... bench:           4 ns/iter (+/- 0)
test bench_fx64_024    ... bench:           3 ns/iter (+/- 0)
test bench_fx64_068    ... bench:           7 ns/iter (+/- 0)
test bench_fx64_132    ... bench:          15 ns/iter (+/- 2)

@cbreeden cbreeden merged commit 04993c8 into cbreeden:master Sep 30, 2019
@Boscop
Copy link

Boscop commented Dec 15, 2020

@cbreeden Could you please publish a new release to get this improvement in the crates.io version? :)

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.

3 participants