-
Notifications
You must be signed in to change notification settings - Fork 4
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
Stabilize #9
Stabilize #9
Conversation
Configuration is no longer required, because rustfmt no longer sucks.
cargo will by default recognize tests in the tests/ folder. Use this folder instead of a conditinal `tests` module at the root of the library
runnable with `cargo +nightly bench`
@Dr-Emann's patch adds As a side note, if you're reading, what's the story on calls to black_box outside the benchmark iteration context? I didn't remove those, but I kind of got the idea they wouldn't do anything. |
Nothing bit--just formatting changes for numbers, mostly.
8da1266
to
320bb0c
Compare
I have decided against |
Dr-emann's quickcheck tests uncovered a pair of input error cases that were unaccounted for by the original impl, which had no capacity to actually return an error anyway: 1. UTF-8 characters not in the provided hashids alphabet. 2. Encoded hashids values outside the range of u64. These have been addressed by changing from Option to Result for the decoding return type and by the addition of a wrapping_pow function based on the checked_pow function of the num crate.
320bb0c
to
72c621f
Compare
Leaning toward not stabilizing right now and instead releasing a 0.2.0-rc. I would prefer to present a less disjointed interface, with everything returning result values rather than some things returning options and others returning results. This is especially true in light of what I have learned recently about the performance characteristics of option values... ...Even if those can hardly be considered relevant, particularly for encoding. :) As another side note, if I'm reading those benchmarks @Dr-Emann provided correctly, encoding takes much, much longer than decoding. Any thoughts? :| |
There's no benefit to using black_box outside the |
My results don't look like there's a huge difference between encoding and decoding, and if anything encoding is slightly faster than decoding:
with rustc version |
Aw crap, you're right... I saw the blackbox thing around the encode and
assumed that it was measuring the encode that leads into the decode call.
I'll get around this eventually. :)
…On Fri, Feb 2, 2018 at 1:25 PM Zachary Dremann ***@***.***> wrote:
My results don't look like there's a huge difference between encoding and
decoding, and if anything encoding is slightly faster than decoding:
running 4 tests
test custom_creation ... bench: 5,566 ns/iter (+/- 2,769)
test decode ... bench: 179,099 ns/iter (+/- 61,987)
test default_creation ... bench: 3,059 ns/iter (+/- 1,301)
test encode ... bench: 144,143 ns/iter (+/- 36,351)
with rustc version rustc 1.25.0-nightly (56733bc9f 2018-02-01) on a
windows machine
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AApeRmmEvUHFTMJxyCJ890DEYdc_jrfPks5tQ2E3gaJpZM4Rh5zc>
.
|
Looks like this is finally going to get done, but I rewrote the error code a different way. |
Outstanding items:
Harsh::decode_single(foo)
as a counterpart toHarsh::encode_single(foo)
Harsh::encode_into(foo)
(wording? -.-) so users can reuse existing string buffersNote: the first part above might require fuzzing. Just saying. Hell if I know.