Skip to content
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

ACIR gen extremely slow for eddsa #1750

Closed
joss-aztec opened this issue Jun 19, 2023 · 7 comments · Fixed by #1793
Closed

ACIR gen extremely slow for eddsa #1750

joss-aztec opened this issue Jun 19, 2023 · 7 comments · Fixed by #1793
Assignees
Labels
bug Something isn't working refactor ssa

Comments

@joss-aztec
Copy link
Contributor

Aim

Compile time should be comparable to old SSA solution.

Expected Behavior

^

Bug

Compiling the example eddsa with --experimental-ssa takes approximately 13 minutes on my 2.3 GHz 8-Core Intel Core i9 MacBook Pro. By contrast the old implementation only takes 1 minute to compile. The time is spent predominantly in ACIR gen.

To Reproduce

Installation Method

None

Nargo Version

No response

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@joss-aztec joss-aztec added the bug Something isn't working label Jun 19, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Jun 19, 2023
@joss-aztec
Copy link
Contributor Author

I'm timing this again and it's taking a lot longer than 13 minutes this run... already passed 30mins

@joss-aztec
Copy link
Contributor Author

Over an hour has passed - killing it.

@jfecher
Copy link
Contributor

jfecher commented Jun 21, 2023

The eddsa test is now hanging during calling find_branch_ends in the flattening pass.

Edit: sha256_byte is also hanging on find_branch_ends

@jfecher
Copy link
Contributor

jfecher commented Jun 21, 2023

Because acir-gen iterates instruction by instruction it is fairly easy to get a progress bar of how far and how fast it is going. My initial impressions are:

  1. It is much too slow for larger programs, of course as identified by this issue, and
  2. It seems to get slower with each additional instruction pushed. At instruction 6000/67000 it was taking ~3.5-4s to process 100 instructions. At instruction 20000 / 67000 it was taking closer to 7s. Even if we assume 7s managed to be the average speed, estimated completion time for 67k instructions is over 78 minutes.
  3. It is not memory bound. At the 20k instruction point mentioned earlier, it was still only using 2% of my computer's memory.

@kevaundray kevaundray added the e2e label Jun 22, 2023
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Jun 22, 2023
@kevaundray
Copy link
Contributor

Re-opening this issue as eddsa takes a long time still cc @Ethan-000 for visibility

@Ethan-000
Copy link
Contributor

not sure what the ideal speed should be this is the result

bench_eddsa

benchmarked with code https://github.com/Ethan-000/noir/tree/b_eddsa

@Ethan-000
Copy link
Contributor

another run
bench eddsa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working refactor ssa
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants