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

test(benchmarks): add benchmarks for proof generation #1082

Closed
wants to merge 1 commit into from

Conversation

ctrlc03
Copy link
Collaborator

@ctrlc03 ctrlc03 commented Jan 22, 2024

Description

Add benchmarks that compare how much time it takes to generate proofs for different number of signups and messages. Both using WASM and Rapidsnark with c witness gen.

Related issue(s)

Re: #1081

Confirmation

Copy link

netlify bot commented Jan 22, 2024

Deploy Preview for maci-typedoc ready!

Name Link
🔨 Latest commit 6a5b353
🔍 Latest deploy log https://app.netlify.com/sites/maci-typedoc/deploys/65aedcba041a90000839ba6d
😎 Deploy Preview https://deploy-preview-1082--maci-typedoc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ctrlc03 ctrlc03 self-assigned this Jan 22, 2024
Copy link
Collaborator

@0xmad 0xmad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ctrlc03 thanks, just few comments.


const NAME = "proof generation";

// eslint-disable-next-line @typescript-eslint/require-await
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need to return promise if there is no await?

integrationTests/ts/__benchmarks__/benchmarks.ts Outdated Show resolved Hide resolved
integrationTests/ts/__benchmarks__/benchmarks.ts Outdated Show resolved Hide resolved
Comment on lines 90 to 110
for (let i = 0; i < users.length; i += 1) {
const keypair = users[i];
maciState.signUp(keypair.pubKey, voiceCreditBalance, BigInt(Date.now()));

// First command (valid)
const command = new PCommand(
BigInt(i) + 1n,
keypair.pubKey,
5n, // voteOptionIndex,
7n, // vote weight
2n, // nonce
pollId,
);

const signature = command.sign(keypair.privKey);

const ecdhKeypair = new Keypair();
const sharedKey = Keypair.genEcdhSharedKey(ecdhKeypair.privKey, coordinatorKeypair.pubKey);
const message = command.encrypt(signature, sharedKey);
poll?.publishMessage(message, ecdhKeypair.pubKey);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems this one is duplicated too.

integrationTests/ts/__tests__/utils/constants.ts Outdated Show resolved Hide resolved
integrationTests/ts/__benchmarks__/benchmarks.ts Outdated Show resolved Hide resolved
@ctrlc03 ctrlc03 force-pushed the test/benchmarks branch 3 times, most recently from c3b1e4b to 80e9f6f Compare January 22, 2024 18:10
Copy link
Collaborator

@kittybest kittybest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!
wanna ask if we wanna gitignore the benchmark output?

integrationTests/ts/__benchmarks__/benchmarks.ts Outdated Show resolved Hide resolved
@ctrlc03 ctrlc03 marked this pull request as draft January 22, 2024 19:15
@ctrlc03 ctrlc03 force-pushed the test/benchmarks branch 2 times, most recently from 08a9886 to fed3612 Compare January 22, 2024 21:18
@samajammin samajammin added the blocked Task or PR is blocked with something label Feb 6, 2024
@ctrlc03
Copy link
Collaborator Author

ctrlc03 commented Jul 26, 2024

Closing for now as most of the code is outdated

@ctrlc03 ctrlc03 closed this Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Task or PR is blocked with something
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants