AztecProtocol / aztec-packages

Apache License 2.0
184 stars 184 forks source link

chore: reduce max read requests #7260

Closed dbanks12 closed 3 months ago

dbanks12 commented 3 months ago

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @dbanks12 and the rest of your teammates on Graphite Graphite

AztecBot commented 3 months ago

Benchmark results

Metrics with a significant change:

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](https://aztec-ci-artifacts.s3.us-east-2.amazonaws.com/benchmarks-v1/pulls/7260.json). ### 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_30_ms | 11,701 (-3%) | 3,155 (-2%) | 1,683 (-9%) | 1,552 (-4%) | 1,560 | proof_construction_time_sha256_100_ms | 43,752 (-3%) | 11,748 (-2%) | 5,441 (-2%) | 5,389 (-2%) | 5,356 (-2%) | proof_construction_time_poseidon_hash_ms | 78.0 (-2%) | 34.0 (-3%) | 34.0 (-3%) | 58.0 (-2%) | 88.0 | proof_construction_time_poseidon_hash_30_ms | 1,516 (-3%) | 415 (-2%) | 201 (-1%) | 230 (-1%) | 267 (-1%) | proof_construction_time_poseidon_hash_100_ms | 5,741 (-3%) | 1,560 (-2%) | 722 (-2%) | 767 (-2%) | 794 (-2%) | ### 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,464 | 9,470 | 9,476 | l1_rollup_execution_gas | 611,203 | 611,360 | 611,517 | l2_block_processing_time_in_ms | 757 (-3%) | 1,419 | 2,724 (-3%) | l2_block_building_time_in_ms | :warning: 20,835 (**-21%**) | 41,768 (-15%) | :warning: 81,710 (**-21%**) | l2_block_rollup_simulation_time_in_ms | :warning: 20,835 (**-21%**) | 41,768 (-15%) | :warning: 81,710 (**-21%**) | l2_block_public_tx_process_time_in_ms | :warning: 17,839 (**-21%**) | :warning: 38,567 (**-16%**) | :warning: 78,549 (**-21%**) | ### 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 | 7,050 | 9,924 | node_database_size_in_bytes | 12,218,448 | 16,183,376 | pxe_database_size_in_bytes | 16,254 | 26,813 | ### 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 | 102 (-12%) | :warning: 387 (**-16%**) | 12,983 (-2%) | 19,482 (-6%) | :warning: 54,134 (**-19%**) | :warning: 73,920 (**-20%**) | :warning: 2,243 (**-20%**) | 524,288 | private-kernel-inner | 308 (-15%) | :warning: 806 (**-25%**) | 51,524 (+6%) | 80,694 (-15%) | :warning: 54,134 (**-19%**) | :warning: 73,920 (**-20%**) | :warning: 2,243 (**-20%**) | 2,097,152 | private-kernel-tail | 277 (-9%) | :warning: 2,134 (**+21%**) | 47,432 (-3%) | 86,065 (-13%) | 62,057 (-13%) | 14,912 | 399 | 2,097,152 | base-parity | 6.14 (-2%) | 1,544 (-15%) | 2,637 (-7%) | 128 | 64.0 | 2,208 | 2.00 | 131,072 | root-parity | 48.9 (-3%) | 70.0 (-7%) | 40,913 (-1%) | 27,100 | 64.0 | 2,720 | 18.0 | 2,097,152 | base-rollup | :warning: 6,551 (**-17%**) | 5,035 (+1%) | 93,116 (+9%) | 170,330 | 728 | 3,648 | 47.0 | 4,194,304 | root-rollup | 110 (-2%) | 80.2 (-13%) | 23,002 (-3%) | 25,253 | 620 | 3,456 | 41.0 | 1,048,576 | public-kernel-setup | 545 (-15%) | :warning: 2,454 (**-35%**) | 42,626 (-6%) | 102,121 (-13%) | 80,278 (-14%) | 106,912 (-15%) | 3,274 (-15%) | 2,097,152 | public-kernel-app-logic | :warning: 501 (**-16%**) | :warning: 3,422 (**-28%**) | 45,213 (-7%) | 102,121 (-13%) | 80,278 (-14%) | 106,912 (-15%) | 3,274 (-15%) | 2,097,152 | public-kernel-tail | :warning: 1,148 (**-19%**) | :warning: 25,368 (**-35%**) | 180,507 (-3%) | :warning: 399,014 (**-22%**) | 10,014 | 14,912 | 399 | 8,388,608 | private-kernel-reset-small | :warning: 467 (**-16%**) | :warning: 1,081 (**-45%**) | :warning: 27,873 (**-42%**) | 109,233 (-11%) | :warning: 54,134 (**-19%**) | :warning: 73,920 (**-20%**) | :warning: 2,243 (**-20%**) | :warning: 1,048,576 (**-50%**) | public-kernel-teardown | 495 (-14%) | :warning: 3,473 (**-29%**) | 44,325 (-8%) | 102,121 (-13%) | 80,278 (-14%) | 106,912 (-15%) | 3,274 (-15%) | 2,097,152 | merge-rollup | 29.3 (-2%) | N/A | N/A | 16,486 | 728 | N/A | N/A | N/A | private-kernel-tail-to-public | N/A | 6,716 (-3%) | :warning: 51,828 (**-46%**) | N/A | N/A | 106,912 (-15%) | 3,274 (-15%) | :warning: 2,097,152 (**-50%**) | 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 | 8,792 (-12%) | 406 (-2%) | N/A | N/A | N/A | N/A | ContractInstanceDeployer:deploy | 1,408 | 8,792 (-12%) | 38.7 (-3%) | N/A | N/A | N/A | N/A | MultiCallEntrypoint:entrypoint | 1,920 | 8,792 (-12%) | 1,186 (-10%) | N/A | N/A | N/A | N/A | GasToken:deploy | 1,376 | 8,792 (-12%) | 898 (-7%) | N/A | N/A | N/A | N/A | SchnorrAccount:constructor | 1,312 | 8,792 (-12%) | 488 (-2%) | N/A | N/A | N/A | N/A | SchnorrAccount:entrypoint | 2,304 | 8,792 (-12%) | 1,621 (-14%) | 14,720 (-12%) | 55,064 (-1%) | 2,097,152 | 393 (-14%) | Token:privately_mint_private_note | 1,280 | 8,792 (-12%) | 623 (-3%) | N/A | N/A | N/A | N/A | FPC:fee_entrypoint_public | 1,344 | 8,792 (-12%) | 269 (-12%) | 14,720 (-12%) | 12,216 (+6%) | 524,288 | 393 (-14%) | Token:transfer | 1,312 | 8,792 (-12%) | :warning: 1,786 (**-38%**) | 14,720 (-12%) | :warning: 12,735 (**-44%**) | :warning: 524,288 (**-50%**) | 393 (-14%) | AuthRegistry:set_authorized (avm) | 19,226 (-8%) | N/A | N/A | 91,264 (-3%) | 1,392 (-2%) | N/A | N/A | FPC:prepare_fee (avm) | 26,668 (-6%) | N/A | N/A | 91,328 (-3%) | 2,961 (-7%) | N/A | N/A | Token:transfer_public (avm) | 42,884 (-4%) | N/A | N/A | 91,328 (-3%) | 3,958 (-2%) | N/A | N/A | AuthRegistry:consume (avm) | 33,104 (-5%) | N/A | N/A | 91,264 (-3%) | 2,935 (-2%) | N/A | N/A | FPC:pay_refund (avm) | 36,833 (-4%) | N/A | N/A | 91,296 (-3%) | 23,367 (-2%) | N/A | N/A | Benchmarking:create_note | 1,344 | 8,792 (-12%) | 478 (-2%) | N/A | N/A | N/A | N/A | SchnorrAccount:verify_private_authwit | 1,280 | 8,792 (-12%) | 71.3 (-1%) | N/A | N/A | N/A | N/A | Token:unshield | 1,376 | 8,792 (-12%) | :warning: 1,535 (**-43%**) | N/A | N/A | N/A | N/A | FPC:fee_entrypoint_private | 1,376 | 8,792 (-12%) | :warning: 2,122 (**-39%**) | N/A | N/A | N/A | N/A | ### AVM Simulation Time to simulate various public functions in the AVM. | Function | time_ms | bytecode_size_in_bytes | | - | - | - | GasToken:_increase_public_balance | 68.8 (-15%) | 13,790 | GasToken:set_portal | 18.6 (-1%) | 3,305 | Token:constructor | 91.5 (-8%) | 23,658 | FPC:constructor | 63.0 (-1%) | 13,592 | GasToken:mint_public | 52.2 (+2%) | 10,158 | Token:mint_public | :warning: 505 (**+598%**) | 19,000 | Token:assert_minter_and_mint | :warning: 55.5 (**-75%**) | 12,891 | AuthRegistry:set_authorized | 32.2 (-3%) | 7,812 | FPC:prepare_fee | 110 (-17%) | 15,062 | Token:transfer_public | :warning: 44.6 (**-39%**) | 31,184 | FPC:pay_refund | 130 (-12%) | 25,260 | Benchmarking:increment_balance | :warning: 2,198 (**-17%**) | 15,233 | Token:_increase_public_balance | 55.6 (-1%) | 14,972 | FPC:pay_refund_with_shielded_rebate | :warning: 116 (**-36%**) | 26,347 | ### Public DB Access Time to access various public DBs. | Function | time_ms | | - | - | get-nullifier-index | 0.155 (-4%) | ### 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 | | - | - | - | - | - | - | - | - | batch_insert_into_append_only_tree_16_depth_ms | 10.3 (-2%) | 16.7 (-2%) | N/A | N/A | N/A | N/A | N/A | batch_insert_into_append_only_tree_16_depth_hash_count | 16.8 | 31.7 | N/A | N/A | N/A | N/A | N/A | batch_insert_into_append_only_tree_16_depth_hash_ms | 0.598 (-2%) | 0.512 (-2%) | N/A | N/A | N/A | N/A | N/A | batch_insert_into_append_only_tree_32_depth_ms | N/A | N/A | 48.2 (-2%) | 75.9 (-2%) | 131 (-4%) | 246 | 469 (-4%) | batch_insert_into_append_only_tree_32_depth_hash_count | N/A | N/A | 95.9 | 159 | 287 | 543 | 1,055 | batch_insert_into_append_only_tree_32_depth_hash_ms | N/A | N/A | 0.492 (-2%) | 0.466 (-2%) | 0.451 (-4%) | 0.445 | 0.438 (-4%) | batch_insert_into_indexed_tree_20_depth_ms | N/A | N/A | 59.4 (-2%) | 112 (-2%) | 183 (-4%) | 354 | 691 (-4%) | batch_insert_into_indexed_tree_20_depth_hash_count | N/A | N/A | 109 | 207 | 355 | 691 | 1,363 | batch_insert_into_indexed_tree_20_depth_hash_ms | N/A | N/A | 0.502 (-2%) | 0.502 (-2%) | 0.484 (-4%) | 0.479 | 0.474 (-4%) | batch_insert_into_indexed_tree_40_depth_ms | N/A | N/A | 72.8 (-1%) | N/A | N/A | N/A | N/A | batch_insert_into_indexed_tree_40_depth_hash_count | N/A | N/A | 133 | N/A | N/A | N/A | N/A | batch_insert_into_indexed_tree_40_depth_hash_ms | N/A | N/A | 0.518 (-1%) | N/A | N/A | N/A | N/A | ### 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 | 74,057 (-14%) | 667,850 | Transaction size based on fee payment method | Metric | | | - | |