-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
p384:
const fn
field arithmetic (#589)
Uses the `fiat-constify` tool to mechanically transform `fiat-crypto` generated field implementations into `const fn`: https://github.com/RustCrypto/utils/tree/master/fiat-constify Resulting code has been run through `rustfmt` prior to checking it in: rustfmt 1.4.38-stable (fe5b13d6 2022-05-18) The following are criterion benchmarks after the translation. While these values are within the threshold of noise I experience running them on a semi-busy desktop computer (MacBook w\ 2.3 GHz 8-Core Intel Core i9) they do paint a picture of a slight performance regression. field element operations/mul time: [60.361 ns 60.755 ns 61.170 ns] change: [+3.0611% +4.1805% +5.1398%] (p = 0.00 < 0.05) Performance has regressed. field element operations/square time: [59.143 ns 59.508 ns 59.924 ns] change: [+4.8440% +5.5441% +6.2283%] (p = 0.00 < 0.05) Performance has regressed. field element operations/invert time: [49.713 us 50.069 us 50.481 us] change: [+14.227% +15.283% +16.277%] (p = 0.00 < 0.05) Performance has regressed. field element operations/sqrt time: [24.936 us 25.064 us 25.206 us] change: [+3.0874% +3.9261% +4.7805%] (p = 0.00 < 0.05) Performance has regressed. point operations/point-scalar mul time: [532.24 us 535.29 us 538.62 us] change: [+2.4804% +3.2221% +3.9748%] (p = 0.00 < 0.05) Performance has regressed. scalar operations/sub time: [7.1834 ns 7.2272 ns 7.2688 ns] change: [+13.036% +13.817% +14.551%] (p = 0.00 < 0.05) Performance has regressed. scalar operations/add time: [9.5314 ns 9.5797 ns 9.6287 ns] change: [+1.2331% +1.9875% +2.6816%] (p = 0.00 < 0.05) Performance has regressed. scalar operations/mul time: [59.303 ns 59.530 ns 59.779 ns] change: [+5.0340% +5.6533% +6.2711%] (p = 0.00 < 0.05) Performance has regressed. scalar operations/negate time: [6.6648 ns 6.6915 ns 6.7244 ns] change: [+0.1937% +1.0485% +1.8021%] (p = 0.01 < 0.05) Change within noise threshold. scalar operations/invert time: [49.255 us 49.365 us 49.489 us] change: [+12.196% +13.079% +13.937%] (p = 0.00 < 0.05) Performance has regressed.
- Loading branch information
Showing
7 changed files
with
17,519 additions
and
17,615 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.