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

Arv/experiment cow opt #3377

Closed
wants to merge 40 commits into from
Closed

Arv/experiment cow opt #3377

wants to merge 40 commits into from

Conversation

sirasistant
Copy link
Collaborator

Please provide a paragraph or two giving a summary of the change, including relevant motivation and context.

Checklist:

Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge.

  • If the pull request requires a cryptography review (e.g. cryptographic algorithm implementations) I have added the 'crypto' tag.
  • I have reviewed my diff in github, line by line and removed unexpected formatting changes, testing logs, or commented-out code.
  • Every change is related to the PR description.
  • I have linked this pull request to relevant issues (if any exist).

Copy link

Updated dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@noir-lang/noir_js 0.16.0...0.19.2 None +3/-3 4.32 MB noir-lang
@noir-lang/noirc_abi 0.16.0...0.19.2 None +0/-0 869 kB noir-lang
@noir-lang/acvm_js 0.28.0...0.30.0 None +0/-0 3.37 MB noir-lang

@AztecBot
Copy link
Collaborator

AztecBot commented Nov 21, 2023

Benchmark results

Metrics with a significant change:

  • circuit_simulation_time_in_ms (private-kernel-init): 266 (-66%)
  • circuit_simulation_time_in_ms (base-rollup): 2,913 (+65%)
  • circuit_simulation_time_in_ms (root-rollup): 90.9 (-47%)
  • circuit_simulation_time_in_ms (private-kernel-inner): 272 (-66%)
  • circuit_simulation_time_in_ms (public-kernel-private-input): 238 (-58%)
  • circuit_simulation_time_in_ms (public-kernel-non-first-iteration): 204 (-50%)
  • circuit_simulation_time_in_ms (merge-rollup): 9.44 (-40%)
  • l2_block_rollup_simulation_time_in_ms (8): 16,716 (+35%)
  • l2_block_rollup_simulation_time_in_ms (32): 66,105 (+37%)
  • l2_block_rollup_simulation_time_in_ms (128): 265,038 (+39%)
  • l2_block_public_tx_process_time_in_ms (8): 4,338 (-51%)
  • l2_block_public_tx_process_time_in_ms (32): 17,275 (-50%)
  • l2_block_public_tx_process_time_in_ms (128): 68,925 (-50%)
  • note_trial_decrypting_time_in_ms (32): 90.4 (+567%)
Detailed results

All benchmarks are run on txs on the Benchmarking contract on the repository. Each tx consists of a batch call to create_note and increment_balance, which guarantees that each tx has a private call, a nested private call, a public call, and a nested public call, as well as an emitted private note, an unencrypted log, and public storage read and write.

This benchmark source data is available in JSON format on S3 here.

Values are compared against data from master at commit 5cfbb68b and shown if the difference exceeds 1%.

L2 block published to L1

Each column represents the number of txs on an L2 block published to L1.

Metric 8 txs 32 txs 128 txs
l1_rollup_calldata_size_in_bytes 45,444 179,588 716,132
l1_rollup_calldata_gas 222,936 868,136 3,449,504
l1_rollup_execution_gas 842,023 3,595,244 22,204,873
l2_block_processing_time_in_ms 2,001 (-2%) 7,577 (-3%) 30,123 (-1%)
note_successful_decrypting_time_in_ms 315 880 (-2%) 3,211 (-2%)
note_trial_decrypting_time_in_ms 19.2 (+3%) ⚠️ 90.4 (+567%) 140 (-1%)
l2_block_building_time_in_ms 21,095 (-1%) 83,520 334,476 (+1%)
l2_block_rollup_simulation_time_in_ms ⚠️ 16,716 (+35%) ⚠️ 66,105 (+37%) ⚠️ 265,038 (+39%)
l2_block_public_tx_process_time_in_ms ⚠️ 4,338 (-51%) ⚠️ 17,275 (-50%) ⚠️ 68,925 (-50%)

L2 chain processing

Each column represents the number of blocks on the L2 chain where each block has 16 txs.

Metric 5 blocks 10 blocks
node_history_sync_time_in_ms 21,836 (-2%) 42,679 (-1%)
note_history_successful_decrypting_time_in_ms 2,067 (-2%) 4,002 (-3%)
note_history_trial_decrypting_time_in_ms 126 (-1%) 153 (-2%)
node_database_size_in_bytes 1,631,412 1,099,344
pxe_database_size_in_bytes 29,748 59,307

Circuits stats

Stats on running time and I/O sizes collected for every circuit run across all benchmarks.

Circuit circuit_simulation_time_in_ms circuit_input_size_in_bytes circuit_output_size_in_bytes
private-kernel-init ⚠️ 266 (-66%) 61,697 18,905
private-kernel-ordering 128 24,297 8,153
base-rollup ⚠️ 2,913 (+65%) 656,428 873
root-rollup ⚠️ 90.9 (-47%) 4,072 1,097
private-kernel-inner ⚠️ 272 (-66%) 81,568 18,905
public-kernel-private-input ⚠️ 238 (-58%) 41,519 18,905
public-kernel-non-first-iteration ⚠️ 204 (-50%) 41,561 18,905
merge-rollup ⚠️ 9.44 (-40%) 2,592 873

Miscellaneous

Transaction sizes based on how many contracts are deployed in the tx.

Metric 0 deployed contracts 1 deployed contracts
tx_size_in_bytes 8,787 27,547

@sirasistant sirasistant mentioned this pull request Nov 24, 2023
4 tasks
sirasistant added a commit that referenced this pull request Nov 24, 2023
This PR ports the logic for the base rollup from CPP to noir. There are
multiple optimizations for this circuit in the pipeline:
- Change the indexed tree insertion algorithm to eliminate the second
branch. Experimental branch here
#3367
- Brillig array optimisation. Experimental branch here
#3377
 - Switch the public data tree to indexed

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [x] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [x] Every change is related to the PR description.
- [x] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).

---------

Co-authored-by: kevaundray <kevtheappdev@gmail.com>
Co-authored-by: ludamad <adam.domurad@gmail.com>
@ludamad ludamad deleted the arv/experiment_cow_opt branch August 22, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants