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

Benchmark and compare with rapidsnark prover #44

Open
oskarth opened this issue Dec 5, 2023 · 3 comments
Open

Benchmark and compare with rapidsnark prover #44

oskarth opened this issue Dec 5, 2023 · 3 comments
Labels
perf Performance related issues

Comments

@oskarth
Copy link
Collaborator

oskarth commented Dec 5, 2023

Problem

Right now we are using ark-groth16 as native prover. This is in Rust and simplifies a lot of things. At the same time, rapidsnark is more mature and with recent optimizations for mobile it might be more performant.

We want to understand the performance diff better, understand where it makes sense and possibly have it as a feature that can be used (switching between provers to use).

Details

See https://github.com/iden3/rapidsnark

Note that currently witness calculation is bottleneck (wasm), not prover. This means this issue isn't super high on the priority list right now. It may become more relevant in the future, especially as prover time is a bottleneck and if it has a bi impact on e.g. older Android devices.

Polygon Identity might also do some benchmarking of Keccak256 using their stack so we get something roughly comparable (albeit perhaps with different devices).

Acceptance criteria

Better data on performance diff for using rapidsnark vs ark-groth16.

@oskarth oskarth changed the title Benchmark and compare with other prover Benchmark and compare with rapidsnark prover Dec 5, 2023
@oskarth oskarth added the perf Performance related issues label Feb 23, 2024
@oskarth
Copy link
Collaborator Author

oskarth commented Feb 23, 2024

This may be relevant with 1.6-1.7m constraints circuits taking ~20s raw prover time (excl witness gen). If this would be cut in half then the additional complexity.

It'd be useful to have intuition for if this is likely or not. Right now I'm about 50/50.

Still not high-prio compared to other perf-related issues.

@oskarth
Copy link
Collaborator Author

oskarth commented Apr 8, 2024

From Florent:

Benchmark for 443351 constraints circuit on iPhone 15 plus
Polygon stack:
- Witnesscalc witness gen:  0.2599910497665405 seconds
- Rapidsnark proving: 4.539696931838989 seconds
WASM witness gen+arkworks:
- Witness generation took: 6.07s
- proof generation took: 4.03s

That native witness generation is faster isn't surprising (and we'd expect this to be faster with circom-witness-rs, once mature enough). I'm a little bit surprised that arkworks is (marginally) faster than rapidsnark.

@oskarth
Copy link
Collaborator Author

oskarth commented May 22, 2024

See here for MacOS by @vivianjeng: https://docs.google.com/spreadsheets/d/1irKg_TOP-yXms8igwCN_3OjVrtFe5gTHkuF0RbrVuho/edit#gid=289866675

iOS (and Android?) come soon from example app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf Performance related issues
Projects
None yet
Development

No branches or pull requests

1 participant