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(readme): Describe steps to benchmark locally and add benchmarks #6907

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Savio-Sou
Copy link
Member

@Savio-Sou Savio-Sou commented Jun 5, 2024

Summary

Documenting #6566.

Supplements steps to run Barretenberg proving time benchmarks for Noir benchmarking programs.

@Savio-Sou Savio-Sou added A-documentation Area: relates to documentation A-benchmarking Area: relates to benchmarking labels Jun 5, 2024
@Savio-Sou Savio-Sou requested a review from TomAFrench June 5, 2024 14:59
@AztecBot
Copy link
Collaborator

AztecBot commented Jun 5, 2024

Benchmark results

Metrics with a significant change:

  • protocol_circuit_witness_generation_time_in_ms (private-kernel-inner): 1,120 (+17%)
  • protocol_circuit_witness_generation_time_in_ms (private-kernel-tail): 2,155 (+18%)
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,728 1,548 698 764 (+2%) 774 (+1%)
proof_construction_time_sha256_30_ms 11,456 (-1%) 3,046 (-1%) 1,375 1,420 1,449
proof_construction_time_sha256_100_ms 43,783 11,787 5,435 5,410 5,370
proof_construction_time_poseidon_hash_ms 78.0 34.0 34.0 57.0 (-2%) 88.0 (+1%)
proof_construction_time_poseidon_hash_30_ms 1,520 420 201 237 (+5%) 279 (+4%)
proof_construction_time_poseidon_hash_100_ms 5,745 1,575 728 (+1%) 787 (+2%) 796

L2 block published to L1

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

Metric 4 txs 8 txs 16 txs
l1_rollup_calldata_size_in_bytes 1,412 1,412 1,412
l1_rollup_calldata_gas 9,476 9,458 9,452
l1_rollup_execution_gas 610,297 610,279 610,273
l2_block_processing_time_in_ms 698 1,289 (-3%) 2,469
l2_block_building_time_in_ms 22,271 45,425 (-3%) 87,217
l2_block_rollup_simulation_time_in_ms 22,166 45,079 (-3%) 86,827
l2_block_public_tx_process_time_in_ms 19,012 41,700 (-3%) 83,537

L2 chain processing

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

Metric 3 blocks 5 blocks
node_history_sync_time_in_ms 5,932 (-4%) 8,491 (-3%)
node_database_size_in_bytes 9,470,032 12,730,448
pxe_database_size_in_bytes 9,242 15,127

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 134 (-1%) 567 (+10%) 13,602 (-2%) 20,634 64,614 89,536 2,731 524,288
private-kernel-inner 389 (-2%) ⚠️ 1,120 (+17%) 52,236 (+3%) 92,326 64,614 89,536 2,731 2,097,152
private-kernel-tail 367 (-2%) ⚠️ 2,155 (+18%) 47,102 (+2%) 96,545 68,261 11,648 297 2,097,152
base-parity 6.48 (-3%) 1,672 (-4%) 2,640 128 64.0 2,208 2.00 131,072
root-parity 49.4 (-9%) 62.0 (+3%) 40,103 (-3%) 27,100 64.0 2,720 18.0 2,097,152
base-rollup 6,465 (-1%) 2,475 (+2%) 84,993 (-2%) 119,738 756 3,648 47.0 4,194,304
root-rollup 113 (+3%) 77.9 (+1%) 24,534 (+3%) 25,309 620 3,456 41.0 1,048,576
public-kernel-app-logic 563 (-2%) 3,496 45,496 (+4%) 108,073 86,550 116,768 3,582 2,097,152
public-kernel-tail 1,132 (-2%) 23,052 (-7%) 186,929 (-2%) 403,238 7,646 11,648 297 8,388,608
private-kernel-reset-small 586 (-2%) 2,096 (+7%) 47,503 (-2%) 120,737 64,614 89,536 2,731 2,097,152
public-kernel-setup 666 (-5%) 2,717 44,058 (-2%) 108,073 86,550 116,768 3,582 2,097,152
public-kernel-teardown 575 (-5%) 3,514 (-2%) 44,611 (-3%) 108,073 86,550 116,768 3,582 2,097,152
merge-rollup 28.7 (-2%) N/A N/A 16,542 756 N/A N/A N/A
private-kernel-tail-to-public N/A 6,956 (-10%) 54,239 (-2%) N/A N/A 116,768 3,582 2,097,152

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 465 (-1%) N/A N/A N/A N/A
ContractInstanceDeployer:deploy 1,408 9,944 40.5 N/A N/A N/A N/A
MultiCallEntrypoint:entrypoint 1,920 9,944 1,791 (+1%) N/A N/A N/A N/A
SchnorrAccount:constructor 1,312 9,944 1,495 (+4%) N/A N/A N/A N/A
SchnorrAccount:entrypoint 2,304 9,944 2,884 (+1%) 16,768 57,000 (+3%) 2,097,152 457
Token:privately_mint_private_note 1,280 9,944 1,569 (-1%) N/A N/A N/A N/A
FPC:fee_entrypoint_public 1,344 9,944 1,042 (-1%) 16,768 10,972 524,288 457
Token:transfer 1,376 9,944 5,310 (-1%) 16,768 54,664 (+2%) 2,097,152 457
Benchmarking:create_note 1,344 9,944 1,480 (+4%) N/A N/A N/A N/A
SchnorrAccount:spend_private_authwit 1,280 9,944 76.4 N/A N/A N/A N/A
Token:unshield 1,376 9,944 3,910 (-1%) N/A N/A N/A N/A
FPC:fee_entrypoint_private 1,376 9,944 4,801 (-1%) 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 256 leaves 512 leaves 1024 leaves 32 leaves
batch_insert_into_append_only_tree_16_depth_ms 10.4 (-1%) 17.0 (-1%) 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
batch_insert_into_append_only_tree_16_depth_hash_ms 0.603 (-1%) 0.521 (-1%) 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.6 (-1%) 76.3 (-2%) 133 247 (-3%) 476 N/A
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A 95.9 159 288 543 1,055 N/A
batch_insert_into_append_only_tree_32_depth_hash_ms N/A N/A 0.496 (-1%) 0.469 (-2%) 0.456 0.448 (-3%) 0.444 N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 59.4 (-1%) 113 (-1%) 184 356 (-3%) 701 N/A
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 108 208 355 691 1,363 N/A
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.505 (-1%) 0.505 (-1%) 0.488 (+1%) 0.482 (-3%) 0.482 N/A
batch_insert_into_indexed_tree_40_depth_ms N/A N/A N/A N/A N/A N/A N/A 60.0 (-2%)
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A N/A N/A N/A N/A N/A 103
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A N/A N/A N/A N/A N/A 0.551 (-2%)

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 79,470 665,267

Transaction size based on fee payment method

| Metric | |
| - | |

@Savio-Sou Savio-Sou changed the title chore(readme): Describe steps to benchmark locally chore(readme): Describe steps to benchmark locally and add benchmarks Jun 5, 2024
Copy link
Member

@TomAFrench TomAFrench left a comment

Choose a reason for hiding this comment

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

Can you make the link to the benchmarks directory point to master rather than an old commit? Otherwise looks fine.

@Savio-Sou Savio-Sou requested a review from TomAFrench June 6, 2024 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-benchmarking Area: relates to benchmarking A-documentation Area: relates to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants