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

feat: Add tool to benchmark RLN proof generation/verification #2410

Merged
merged 1 commit into from
Feb 9, 2024

Conversation

alrevuelta
Copy link
Contributor

Add simple tool to benchmark RLN proof generation and verification.

Run as:

make benchmarks LOG_LEVEL=NOTICE
./build/benchmarks

Output:

Proof generation times: 85 milliseconds, 723 microseconds, and 313 nanoseconds
Proof verification times: 2 milliseconds, 707 microseconds, and 137 nanoseconds

Copy link

github-actions bot commented Feb 9, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2410

Built from 8d1a614

Copy link
Contributor

@rymnc rymnc left a comment

Choose a reason for hiding this comment

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

LGTM

std/sequtils,
stew/results,
options,
../../waku/waku_rln_relay/protocol_types,
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we can just import waku_rln_relay?

var proofGenTimes: seq[times.Duration] = @[]
var proofVerTimes: seq[times.Duration] = @[]

for i in 0 .. 50:
Copy link
Contributor

Choose a reason for hiding this comment

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

in a future iteration can we have this configurable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

imho no need to complicate things. this is intended for devs so just change the value and recompile :)

Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks!

var proofVerTimes: seq[times.Duration] = @[]

for i in 0 .. 50:
var time = getTime()
Copy link
Collaborator

Choose a reason for hiding this comment

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

In case we want to measue CPU-bounded tasks, it would be interesting to use cpuTime instead.

@alrevuelta alrevuelta merged commit e600203 into master Feb 9, 2024
9 of 10 checks passed
@alrevuelta alrevuelta deleted the benchmark-rln branch February 9, 2024 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants