Skip to content

Conversation

@dtolnay
Copy link
Owner

@dtolnay dtolnay commented Sep 16, 2017

@henninglive this one is a little faster than your implementation from #10. Basically it decomposes N into (N / 10^38 % 10) and (N / 10^19 % 10^19) and (N % 10^19).


Unoptimized

test bench_fmt::bench_u128_max  ... bench:       2,532 ns/iter (+/- 219)

PR #10

test bench_itoa::bench_u128_max ... bench:       1,171 ns/iter (+/- 30)

This one

test bench_itoa::bench_u128_max ... bench:         198 ns/iter (+/- 8)

@henninglive
Copy link
Contributor

Wow, that’s fast. This is probably worth submitting as patch to std.

@henninglive
Copy link
Contributor

henninglive commented Sep 16, 2017

We sould alos look into what happens with i64/u64 on x86, can we speed up too.

@henninglive
Copy link
Contributor

henninglive commented Sep 16, 2017

The compiler-builtins copyright notice probably doesn’t apply anymore, you can probably remove it.

@varkor
Copy link

varkor commented Feb 11, 2018

@dtolnay: are you planning to submit this upstream?

@dtolnay
Copy link
Owner Author

dtolnay commented Feb 11, 2018

@varkor I am not planning to do it but it is being tracked in rust-lang/rust#44583.

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.

4 participants