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 Block struct serialization code #2018

Merged
merged 7 commits into from
Apr 19, 2021

Conversation

fanatid
Copy link
Contributor

@fanatid fanatid commented Apr 15, 2021

Motivation

For resolving #1774 there should be a way to determine that improvement was introduced. Benchmark is a good way to see performance changes.
I do not think that it's required to benchmark all structs which implement ZcashSerialize. Block uses a lot (all?) of structs internally, so only Block should be enough.

Solution

Add a simple benchmark for the biggest block from zebra-test created with criterion.

Review

Related Issues

Should close #2019.

Follow Up Work

Create tracking issue for adding benchmarks to CI once this PR is merged.

@zfnd-bot zfnd-bot bot added this to In progress in 🦓 Apr 15, 2021
@dconnolly dconnolly added the A-rust Area: Updates to Rust code label Apr 15, 2021
@dconnolly
Copy link
Contributor

Thanks for this PR! This will benchmark serialization of the largest block test vector we have, but not the messages we support yet, so we should create another issue and resolve that with this PR vs #1775.

And yes we should run all our benchmarks as part of CI, some of our dependencies (ed25519-zebra, redjubjub, bellman) have benchmarks for the batch verification of those signatures/proofs that we may want to run ourselves, or, repurpose them on top of the async services that leverage those batching implementations, and run those instead.

@dconnolly dconnolly linked an issue Apr 15, 2021 that may be closed by this pull request
@teor2345 teor2345 added this to the 2021 Sprint 8 milestone Apr 19, 2021
@mpguerra mpguerra removed this from the 2021 Sprint 8 milestone Apr 19, 2021
Cargo.toml Show resolved Hide resolved
large_multi_transaction_block(),
),
(
"large_single_transaction_block",
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

Let's fix the hard-coded block name, and then we're good to merge.

You can also move the lexical-core change to #2026 if you want, but I don't want to block on that.

Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

Once CI passes, let's auto-merge this PR.

@teor2345 teor2345 enabled auto-merge (squash) April 19, 2021 10:45
@fanatid
Copy link
Contributor Author

fanatid commented Apr 19, 2021

😮 @teor2345 how you pushed 1761a5b to my fork?

@teor2345
Copy link
Contributor

😮 @teor2345 how you pushed 1761a5b to my fork?

GitHub has an "allow maintainer updates" setting on PRs. It's on by default, and it lets maintainers push to your PR branch.

Sorry I should have asked first 🤭

(I always ask for permission for big changes.)

@fanatid
Copy link
Contributor Author

fanatid commented Apr 19, 2021

😮 @teor2345 how you pushed 1761a5b to my fork?

GitHub has an "allow maintainer updates" setting on PRs. It's on by default, and it lets maintainers push to your PR branch.
Sorry I should have asked first 🤭
(I always ask for permission for big changes.)

wow, I thought this checkbox only for editing initial message. TIL 👍

@teor2345 teor2345 merged commit b636cf8 into ZcashFoundation:main Apr 19, 2021
🦓 automation moved this from In progress to Done Apr 19, 2021
@fanatid fanatid deleted the bench-block-ser branch April 19, 2021 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rust Area: Updates to Rust code
Projects
No open projects
🦓
  
Done
Development

Successfully merging this pull request may close these issues.

Benchmark Zebra's block serialization code
4 participants