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

chore: add bench programs #6566

Merged
merged 18 commits into from
May 29, 2024
Merged

chore: add bench programs #6566

merged 18 commits into from
May 29, 2024

Conversation

TomAFrench
Copy link
Member

This PR adds in a number of new benchmark programs.

@TomAFrench TomAFrench marked this pull request as ready for review May 21, 2024 17:11
@AztecBot
Copy link
Collaborator

AztecBot commented May 21, 2024

Benchmark results

Metrics with a significant change:

  • protocol_circuit_witness_generation_time_in_ms (private-kernel-inner): 4,893 (+20%)
  • protocol_circuit_witness_generation_time_in_ms (root-parity): 89.3 (+39%)
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.

Proof generation

Each column represents the number of threads used in proof generation.

Metric 1 threads 4 threads 16 threads 32 threads 64 threads
proof_construction_time_sha256_ms 5,675 1,539 704 757 775
proof_construction_time_sha256_30_ms 11,405 3,058 1,375 1,416 1,456
proof_construction_time_sha256_100_ms 43,529 11,750 5,425 5,968 5,354
proof_construction_time_poseidon_hash_ms 235 79.0 58.0 90.0 149
proof_construction_time_poseidon_hash_30_ms 5,685 1,557 722 789 795
proof_construction_time_poseidon_hash_100_ms 11,236 3,043 1,361 1,398 1,445

L2 block published to L1

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

Metric 8 txs 32 txs 64 txs
l1_rollup_calldata_size_in_bytes 1,412 1,412 1,412
l1_rollup_calldata_gas 9,464 9,476 9,476
l1_rollup_execution_gas 616,105 616,117 616,117
l2_block_processing_time_in_ms 1,304 (+1%) 4,787 (-1%) 9,507 (-1%)
l2_block_building_time_in_ms 46,660 185,100 368,784
l2_block_rollup_simulation_time_in_ms 46,483 184,478 367,465
l2_block_public_tx_process_time_in_ms 24,885 103,818 211,041 (-1%)

L2 chain processing

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

Metric 3 blocks 5 blocks
node_history_sync_time_in_ms 9,489 (+1%) 14,473 (+1%)
node_database_size_in_bytes 14,487,632 21,377,104
pxe_database_size_in_bytes 18,071 29,868

Circuits stats

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

Circuit simulation_time_in_ms witness_generation_time_in_ms proving_time_in_ms input_size_in_bytes output_size_in_bytes proof_size_in_bytes num_public_inputs size_in_gates
private-kernel-init 164 3,557 24,611 (-3%) 20,630 64,614 89,536 2,731 1,048,576
private-kernel-inner 620 (-1%) ⚠️ 4,893 (+20%) 49,704 (-5%) 92,318 64,614 89,536 2,731 2,097,152
private-kernel-tail 544 (-1%) 2,864 (+2%) 43,955 (+1%) 90,237 77,498 10,656 266 2,097,152
base-parity 6.43 (+1%) 1,164 (-4%) 2,847 128 64.0 2,208 2.00 131,072
root-parity 48.9 ⚠️ 89.3 (+39%) 50,318 (-1%) 27,084 64.0 2,720 18.0 2,097,152
base-rollup 793 2,358 (-3%) 90,164 (+4%) 119,610 756 3,648 47.0 4,194,304
root-rollup 111 (-2%) 75.4 (-2%) 24,511 (+7%) 25,297 620 3,456 41.0 1,048,576
public-kernel-app-logic 520 2,806 (-2%) 51,212 (-2%) 104,941 86,302 114,784 3,520 2,097,152
public-kernel-tail 1,180 (-1%) 23,783 (-3%) 182,519 (+1%) 395,386 7,522 10,656 266 8,388,608
private-kernel-reset-small 590 (-1%) 2,067 (-1%) 50,008 (+1%) 120,733 64,614 89,536 2,731 2,097,152
merge-rollup 28.7 N/A N/A 16,534 756 N/A N/A N/A
public-kernel-setup 630 (+1%) N/A N/A 104,941 86,302 N/A N/A N/A
public-kernel-teardown 531 (+1%) N/A N/A 104,941 86,302 N/A N/A N/A
private-kernel-tail-to-public N/A 8,037 (-2%) 96,444 (+3%) N/A N/A 114,784 3,520 4,194,304

Stats on running time collected for app circuits

Function input_size_in_bytes output_size_in_bytes witness_generation_time_in_ms proof_size_in_bytes proving_time_in_ms size_in_gates num_public_inputs
ContractClassRegisterer:register 1,344 9,944 456 (-2%) N/A N/A N/A N/A
ContractInstanceDeployer:deploy 1,408 9,944 40.9 (-1%) N/A N/A N/A N/A
MultiCallEntrypoint:entrypoint 1,920 9,944 1,411 (-2%) N/A N/A N/A N/A
SchnorrAccount:constructor 1,312 9,944 994 (-1%) N/A N/A N/A N/A
SchnorrAccount:entrypoint 2,304 9,944 2,107 (-1%) 16,768 50,664 (+2%) 2,097,152 457
Token:privately_mint_private_note 1,280 9,944 1,094 (-3%) N/A N/A N/A N/A
Token:transfer 1,376 9,944 4,011 (-2%) 16,768 49,623 (-11%) 2,097,152 457
Benchmarking:create_note 1,312 9,944 980 N/A N/A N/A N/A
FPC:fee_entrypoint_public 1,344 9,944 229 (-1%) N/A N/A N/A N/A
SchnorrAccount:spend_private_authwit 1,280 9,944 77.4 (-1%) N/A N/A N/A N/A
Token:unshield 1,376 9,944 3,251 (-3%) N/A N/A N/A N/A
FPC:fee_entrypoint_private 1,376 9,944 4,050 (-3%) N/A N/A N/A N/A

Tree insertion stats

The duration to insert a fixed batch of leaves into each tree type.

Metric 1 leaves 16 leaves 64 leaves 128 leaves 512 leaves 1024 leaves 2048 leaves 4096 leaves 32 leaves
batch_insert_into_append_only_tree_16_depth_ms 10.4 16.9 N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_count 16.7 31.8 N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_ms 0.602 0.519 N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A 48.5 76.8 256 (+4%) 474 929 1,841 N/A
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A 95.9 159 543 1,055 2,079 4,127 N/A
batch_insert_into_append_only_tree_32_depth_hash_ms N/A N/A 0.495 0.473 0.464 (+4%) 0.443 0.440 0.439 N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 58.0 113 (+1%) 356 699 1,384 2,760 N/A
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 106 208 692 1,363 2,707 5,395 N/A
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.502 0.504 (+1%) 0.482 0.480 0.478 0.479 N/A
batch_insert_into_indexed_tree_40_depth_ms N/A N/A N/A N/A N/A N/A N/A N/A 62.3
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A N/A N/A N/A N/A N/A N/A 107
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A N/A N/A N/A N/A N/A N/A 0.551

Miscellaneous

Transaction sizes based on how many contract classes are registered in the tx.

Metric 0 registered classes 1 registered classes
tx_size_in_bytes 83,794 665,117

Transaction size based on fee payment method

| Metric | |
| - | |

@guipublic
Copy link
Contributor

May be we should remove the bench_.. tests from being run by run_acir_tests, since they are run by the benchmarks?

@TomAFrench TomAFrench merged commit edb6db6 into master May 29, 2024
85 checks passed
@TomAFrench TomAFrench deleted the tf/add-extra-bench-programs branch May 29, 2024 10:13
TomAFrench added a commit that referenced this pull request May 29, 2024
* master:
  feat: prepare circuit output for validation (#6678)
  chore: stop building/publishing `acvm_backend.wasm` (#6584)
  chore: add bench programs (#6566)
  chore: make public data update requests, note hashes, and unencrypted logs readonly in TS (#6658)
  git subrepo push --branch=master noir-projects/aztec-nr
  git_subrepo.sh: Fix parent in .gitrepo file. [skip ci]
  chore: replace relative paths to noir-protocol-circuits
  git subrepo push --branch=master barretenberg
  feat: update honk recursion constraint (#6545)
  feat: Add code-workspace and update build dirs (#6723)
  feat: Sync from noir (#6717)
  feat: folding acir programs (#6685)
  feat: sumcheck part of ECCVM recursive verifier instantiated as an UltraCircuit (#6413)
github-merge-queue bot pushed a commit to noir-lang/noir that referenced this pull request Jun 11, 2024
Automated pull of Noir development from
[aztec-packages](https://github.com/AztecProtocol/aztec-packages).
BEGIN_COMMIT_OVERRIDE
chore: add example for recursion on the CLI
(AztecProtocol/aztec-packages#6389)
feat(nargo): hidden option to show contract artifact paths written by
`nargo compile`
(AztecProtocol/aztec-packages#6131)
chore: add bench programs
(AztecProtocol/aztec-packages#6566)
END_COMMIT_OVERRIDE

---------

Co-authored-by: TomAFrench <tom@tomfren.ch>
Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
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.

4 participants