Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Introduce Assembly #5

Closed
wants to merge 23 commits into from
Closed

Conversation

ashWhiteHat
Copy link
Contributor

@ashWhiteHat ashWhiteHat commented Jan 20, 2022

Abstract

I implemented assembly arithmetic #2 so I am going to introduce to field arithmetic to this repo.

What I did

  1. Described simple field arithmetic test
  2. Introduce github actions test
  3. Bench add, sub, double and mul, square arithmetic
  4. Update tool chain
  5. Introduce add, sub and double, mul, neg assembly method
  6. Replace Fq ~ Fq12 and Fr arithmetic with assembly if features = ["asm"]

Progress

Optimizing instruction according to here

Performance

Environment: Github Actions
Number of operations: 1000000

Result is here

fq

Arithmetic Default Assembly Reduction Rate
addition 364.510ms 280.245ms 23.12 %
subtraction 236.869ms 180.653ms 23.73%
doubling 136.012ms 111.777ms 17.82%
multiplication 591.789ms 464.390ms 21.53%
squaring 201.071ms 158.661ms 21.09%
negation 129.898ms 108.840ms 16.21%
expansion 633.768ms 507.126ms 19.98%
inversion 24.067s 18.858s 21.64%

fr

Arithmetic Default Assembly Reduction Rate
addition 380.275ms 285.533ms 24.91%
subtraction 235.534ms 188.833ms 19.83%
doubling 135.003ms 114.632ms 15.09%
multiplication 603.598ms 453.916ms 24.80%
squaring 189.001ms 173.377ms 8.27%
negation 124.072ms 118.184ms 4.75%
expansion 605.518ms 507.126ms 16.25%
inversion 20.368s 18.858s 7.41%

fq12

Arithmetic Default Assembly Reduction Rate
addition 4.609s 3.919s 14.97%
subtraction 4.609s 2.356s 48.88%
doubling 1.595s 1.269s 20.44%
multiplication 28.062s 22.235s 20.76%
squaring 8.342s 6.668s 20.07%
negation 1.565s 1.247s 20.32%
expansion 25.480s 20.214s 20.67%
inversion 36.619s 29.090s 20.56%

@ashWhiteHat ashWhiteHat changed the title Introduce Assembly [WIP]Introduce Assembly Jan 20, 2022
@ashWhiteHat ashWhiteHat force-pushed the introduce-assembly-complete branch 2 times, most recently from 0e10823 to 4d56383 Compare January 21, 2022 07:17
@ashWhiteHat ashWhiteHat changed the title [WIP]Introduce Assembly Introduce Assembly Jan 21, 2022
@ashWhiteHat ashWhiteHat changed the base branch from master to introduce-assembly January 26, 2022 23:55
@ashWhiteHat ashWhiteHat changed the base branch from introduce-assembly to master January 26, 2022 23:55
@kilic kilic deleted the introduce-assembly-complete branch May 6, 2022 19:20
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.

1 participant