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: Do not import big jsons v2 #6977

Closed
wants to merge 3 commits into from

Conversation

spalladino
Copy link
Collaborator

Another round of #6972

@AztecBot
Copy link
Collaborator

AztecBot commented Jun 7, 2024

Benchmark results

Metrics with a significant change:

  • avm_simulation_time_ms (Token:transfer_public): 43.9 (+40%)
  • protocol_circuit_witness_generation_time_in_ms (private-kernel-tail): 1,813 (-23%)
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_30_ms 11,404 (-1%) 3,156 (+1%) 1,626 (-10%) 1,613 (+7%) 1,474
proof_construction_time_sha256_100_ms 45,334 12,289 (+1%) 5,824 5,700 5,612
proof_construction_time_poseidon_hash_ms 78.0 34.0 34.0 58.0 (+2%) 87.0
proof_construction_time_poseidon_hash_30_ms 1,517 419 203 (-1%) 223 (+1%) 269 (+1%)
proof_construction_time_poseidon_hash_100_ms 5,746 1,575 735 (-1%) 792 (+1%) 801

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 610,285 610,291 610,297
l2_block_processing_time_in_ms 756 1,409 (-1%) 2,706
l2_block_building_time_in_ms 25,250 (-2%) 50,722 (-1%) 99,089 (-2%)
l2_block_rollup_simulation_time_in_ms 25,154 (-2%) 50,410 (-1%) 98,735 (-2%)
l2_block_public_tx_process_time_in_ms 21,628 (-2%) 46,666 (-1%) 95,043 (-2%)

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 6,983 (-1%) 9,880
node_database_size_in_bytes 12,132,432 16,085,072
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 130 (+1%) 461 (-4%) 13,091 (+4%) 20,634 67,190 92,352 2,819 524,288
private-kernel-inner 397 (+2%) 1,036 (+10%) 48,501 94,902 67,190 92,352 2,819 2,097,152
private-kernel-tail 370 ⚠️ 1,813 (-23%) 50,786 (-1%) 99,121 71,733 14,912 399 2,097,152
base-parity 6.26 (-1%) 1,866 (+2%) 2,749 (+1%) 128 64.0 2,208 2.00 131,072
root-parity 48.8 72.8 (-2%) 42,493 (+5%) 27,100 64.0 2,720 18.0 2,097,152
base-rollup 7,849 (-1%) 4,876 (+1%) 84,130 (+1%) 170,330 756 3,648 47.0 4,194,304
root-rollup 110 92.0 (+4%) 24,382 25,309 620 3,456 41.0 1,048,576
public-kernel-setup 719 (+1%) 3,665 44,765 (+1%) 116,905 93,334 125,344 3,850 2,097,152
public-kernel-app-logic 609 (-1%) 4,641 (-3%) 43,955 (-9%) 116,905 93,334 125,344 3,850 2,097,152
public-kernel-tail 1,403 36,739 (+3%) 194,109 (+3%) 511,910 10,014 14,912 399 8,388,608
private-kernel-reset-small 592 2,087 (+1%) 46,912 123,313 67,190 92,352 2,819 2,097,152
public-kernel-teardown 617 4,717 (+1%) 46,616 (-2%) 116,905 93,334 125,344 3,850 2,097,152
merge-rollup 28.6 (-1%) N/A N/A 16,542 756 N/A N/A N/A
private-kernel-tail-to-public N/A 6,893 (+2%) 97,033 (-3%) N/A N/A 125,344 3,850 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 419 (-1%) N/A N/A N/A N/A
ContractInstanceDeployer:deploy 1,408 9,944 39.7 (+1%) N/A N/A N/A N/A
MultiCallEntrypoint:entrypoint 1,920 9,944 1,795 (+1%) N/A N/A N/A N/A
GasToken:deploy 1,376 9,944 982 (+2%) N/A N/A N/A N/A
SchnorrAccount:constructor 1,312 9,944 1,427 (+1%) N/A N/A N/A N/A
SchnorrAccount:entrypoint 2,304 9,944 2,872 (+2%) 16,768 55,155 (-2%) 2,097,152 457
Token:privately_mint_private_note 1,280 9,944 1,645 N/A N/A N/A N/A
FPC:fee_entrypoint_public 1,344 9,944 346 (-1%) 16,768 11,161 (-1%) 524,288 457
Token:transfer 1,312 9,944 4,393 (-1%) 16,768 45,508 (-2%) 2,097,152 457
AuthRegistry:set_authorized (avm) 21,043 N/A N/A 87,200 1,359 (+3%) N/A N/A
FPC:prepare_fee (avm) 28,841 N/A N/A 88,032 5,762 (+1%) N/A N/A
Token:transfer_public (avm) 44,971 N/A N/A 87,865 4,708 N/A N/A
AuthRegistry:consume (avm) 34,973 N/A N/A 87,616 2,964 (+1%) N/A N/A
FPC:pay_refund (avm) 33,573 N/A N/A 88,448 11,042 (-1%) N/A N/A
Benchmarking:create_note 1,344 9,944 1,468 (+5%) N/A N/A N/A N/A
SchnorrAccount:verify_private_authwit 1,280 9,944 73.2 N/A N/A N/A N/A
Token:unshield 1,376 9,944 3,606 N/A N/A N/A N/A
FPC:fee_entrypoint_private 1,376 9,944 4,562 (+1%) 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.7 (+5%) 13,873
GasToken:set_portal 17.9 (+7%) 3,495
Token:constructor 92.6 24,207
FPC:constructor 61.3 (+1%) 13,893
GasToken:mint_public 51.7 (-1%) 10,241
Token:mint_public 67.2 (+11%) 19,216
Token:assert_minter_and_mint 203 (-7%) 13,034
AuthRegistry:set_authorized 31.5 (-4%) 7,869
FPC:prepare_fee 142 (-1%) 15,187
Token:transfer_public ⚠️ 43.9 (+40%) 31,425
FPC:pay_refund 140 (-3%) 20,080
Benchmarking:increment_balance 2,667 (-1%) 15,465
Token:_increase_public_balance 56.6 (+3%) 15,089
FPC:pay_refund_with_shielded_rebate 153 (+7%) 21,167

Public DB Access

Time to access various public DBs.

Function time_ms
get-nullifier-index 0.151 (-1%)

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 (-1%) 16.7 (-1%) 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.596 0.512 (-1%) N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A 48.4 75.6 (-1%) 132 244 (-1%) 473
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.494 0.465 (-1%) 0.452 0.443 0.441
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 59.5 112 183 (-1%) 352 (-1%) 696
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.504 0.501 0.485 0.477 (-1%) 0.477
batch_insert_into_indexed_tree_40_depth_ms N/A N/A 72.5 (-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.517 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 85,672 670,983

Transaction size based on fee payment method

| Metric | |
| - | |

@spalladino spalladino force-pushed the palla/do-not-import-big-jsons-v2 branch from 991e4d7 to 50d9bb3 Compare June 24, 2024 15:47
@spalladino
Copy link
Collaborator Author

Closing in favor of #7181

@spalladino spalladino closed this Jul 5, 2024
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.

2 participants