Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

mul and from optimizations #23

Merged
merged 3 commits into from
Aug 17, 2017
Merged

Conversation

debris
Copy link
Contributor

@debris debris commented Aug 17, 2017

  • mul is ~30% faster
  • from_little_endian / from_big_endian is ~80% faster

before:

test u128_mul      ... bench:     151,032 ns/iter (+/- 32,331)
test u256_from_be  ... bench:          57 ns/iter (+/- 0)
test u256_from_le  ... bench:           51 ns/iter (+/- 1)
test u256_full_mul ... bench:     228,725 ns/iter (+/- 30,183)
test u256_mul      ... bench:     123,390 ns/iter (+/- 32,967)

after:

test u128_mul      ... bench:      98,213 ns/iter (+/- 13,330)
test u256_from_be  ... bench:          13 ns/iter (+/- 0)
test u256_from_le  ... bench:           7 ns/iter (+/- 0)
test u256_full_mul ... bench:     199,849 ns/iter (+/- 19,195)
test u256_mul      ... bench:     105,883 ns/iter (+/- 14,433)

pleasereview @NikVolf / @Vurich

@NikVolf
Copy link
Contributor

NikVolf commented Aug 17, 2017

Wow, this is awesome, thanks!

@NikVolf
Copy link
Contributor

NikVolf commented Aug 17, 2017

I've just realized we don't have a test that verifies that from_* functions actually do work in the right order

care to merge pr #24 into your one to actually check this?

@debris
Copy link
Contributor Author

debris commented Aug 17, 2017

sure, done

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants