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 #6972

Closed
wants to merge 4 commits into from

Conversation

spalladino
Copy link
Collaborator

VSCode has been struggling lately with the typescript side of things. This is an attempt to fix that by not forcing the poor parser to go through massive json files, and instead just load on runtime the good old fashioned way.

Copy link
Contributor

github-actions bot commented Jun 7, 2024

Changes to circuit sizes

Generated at commit: f9518b3b088dcbf06c75aa6d91ba7c8b825adb7a, compared to commit: f330bffa80b6da5f037cea3cf469ef1c7b6d9d03

🧾 Summary (100% most significant diffs)

Program ACIR opcodes (+/-) % Circuit size (+/-) %
public_kernel_setup -205 ✅ -0.08% -5,157 ✅ -0.31%
public_kernel_teardown -269 ✅ -0.09% -9,681 ✅ -0.52%
public_kernel_app_logic -269 ✅ -0.09% -9,681 ✅ -0.52%

Full diff report 👇
Program ACIR opcodes (+/-) % Circuit size (+/-) %
public_kernel_setup 244,113 (-205) -0.08% 1,645,111 (-5,157) -0.31%
public_kernel_teardown 295,149 (-269) -0.09% 1,842,270 (-9,681) -0.52%
public_kernel_app_logic 294,951 (-269) -0.09% 1,842,031 (-9,681) -0.52%

@spalladino
Copy link
Collaborator Author

So this breaks everything browser

@AztecBot
Copy link
Collaborator

AztecBot commented Jun 7, 2024

Benchmark results

Metrics with a significant change:

  • protocol_circuit_proving_time_in_ms (base-rollup): 85,767 (+24%)
  • protocol_circuit_proving_time_in_ms (root-parity): 40,215 (+19%)
  • protocol_circuit_proving_time_in_ms (public-kernel-setup): 44,724 (+20%)
  • protocol_circuit_proving_time_in_ms (public-kernel-app-logic): 45,247 (+18%)
  • protocol_circuit_proving_time_in_ms (public-kernel-teardown): 46,165 (+18%)
  • protocol_circuit_proving_time_in_ms (public-kernel-tail): 185,277 (+19%)
  • protocol_circuit_proving_time_in_ms (root-rollup): 24,218 (+22%)
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,766 1,562 710 (+1%) 751 779 (+1%)
proof_construction_time_sha256_30_ms 11,554 (-1%) 3,103 1,381 (+1%) 1,426 1,456 (-1%)
proof_construction_time_sha256_100_ms 44,274 11,841 5,449 5,425 5,426 (+1%)
proof_construction_time_poseidon_hash_ms 78.0 34.0 34.0 58.0 (-3%) 87.0 (-1%)
proof_construction_time_poseidon_hash_30_ms 1,529 422 202 226 (-3%) 266 (-1%)
proof_construction_time_poseidon_hash_100_ms 5,798 1,612 (+1%) 733 784 (-1%) 808 (+1%)

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,446 9,452
l1_rollup_execution_gas 610,285 610,267 610,273
l2_block_processing_time_in_ms 693 1,286 (-1%) 2,456
l2_block_building_time_in_ms 22,525 45,644 (-1%) 87,669 (-1%)
l2_block_rollup_simulation_time_in_ms 22,420 45,297 (-1%) 87,281 (-1%)
l2_block_public_tx_process_time_in_ms 19,308 41,859 (-1%) 84,024

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,921 8,497
node_database_size_in_bytes 9,498,704 12,763,216 (+1%)
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 136 (+1%) 466 (-6%) 13,588 (+10%) 20,634 64,614 89,536 2,731 524,288
private-kernel-inner 393 954 (-5%) 50,083 (+10%) 92,326 64,614 89,536 2,731 2,097,152
private-kernel-tail 370 1,801 (-3%) 43,963 (+15%) 96,545 69,406 11,648 297 2,097,152
base-parity 6.54 (+1%) 1,916 (-1%) 2,771 (+11%) 128 64.0 2,208 2.00 131,072
root-parity 50.4 (+1%) 57.2 (+13%) ⚠️ 40,215 (+19%) 27,100 64.0 2,720 18.0 2,097,152
base-rollup 7,525 (-1%) 2,461 (+6%) ⚠️ 85,767 (+24%) 119,738 756 3,648 47.0 4,194,304
root-rollup 110 (-2%) 73.1 (+16%) ⚠️ 24,218 (+22%) 25,309 620 3,456 41.0 1,048,576
public-kernel-setup 664 (-3%) 2,749 (+5%) ⚠️ 44,724 (+20%) 108,073 86,550 116,768 3,582 2,097,152
public-kernel-app-logic 566 (-1%) 3,538 ⚠️ 45,247 (+18%) 108,073 86,550 116,768 3,582 2,097,152
public-kernel-tail 1,141 (-1%) 23,860 (+15%) ⚠️ 185,277 (+19%) 403,238 7,646 11,648 297 8,388,608
private-kernel-reset-small 590 1,937 (-8%) 48,093 (+12%) 120,737 64,614 89,536 2,731 2,097,152
public-kernel-teardown 565 (-5%) 3,578 (+4%) ⚠️ 46,165 (+18%) 108,073 86,550 116,768 3,582 2,097,152
merge-rollup 29.0 N/A N/A 16,542 756 N/A N/A N/A
private-kernel-tail-to-public N/A 6,927 (-3%) 53,132 (+11%) 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 459 (-3%) N/A N/A N/A N/A
ContractInstanceDeployer:deploy 1,408 9,944 40.3 (-2%) N/A N/A N/A N/A
MultiCallEntrypoint:entrypoint 1,920 9,944 2,062 (+2%) N/A N/A N/A N/A
GasToken:deploy 1,376 9,944 988 (-4%) N/A N/A N/A N/A
SchnorrAccount:constructor 1,312 9,944 1,441 (-2%) N/A N/A N/A N/A
SchnorrAccount:entrypoint 2,304 9,944 2,816 (-2%) 16,768 54,389 (+7%) 2,097,152 457
Token:privately_mint_private_note 1,280 9,944 1,589 (-5%) N/A N/A N/A N/A
FPC:fee_entrypoint_public 1,344 9,944 1,056 (-8%) 16,768 10,988 (+9%) 524,288 457
Token:transfer 1,376 9,944 5,323 (-3%) 16,768 53,870 (+12%) 2,097,152 457
Benchmarking:create_note 1,344 9,944 1,390 (-1%) N/A N/A N/A N/A
SchnorrAccount:spend_private_authwit 1,280 9,944 75.9 (-1%) N/A N/A N/A N/A
Token:unshield 1,376 9,944 3,872 (-3%) N/A N/A N/A N/A
FPC:fee_entrypoint_private 1,376 9,944 4,786 (-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 256 leaves 512 leaves 1024 leaves 32 leaves
batch_insert_into_append_only_tree_16_depth_ms 10.4 (-2%) 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.606 (-2%) 0.519 (-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.9 76.0 (-1%) 133 (-1%) 246 (-3%) 475 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.499 0.468 (-1%) 0.456 (-1%) 0.446 (-3%) 0.443 N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 60.8 (+1%) 112 (-2%) 184 (-1%) 355 (-1%) 700 N/A
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 109 208 355 691 1,363 N/A
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.514 (+1%) 0.504 (-1%) 0.487 0.480 (-1%) 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.6
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.553

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,300 673,633

Transaction size based on fee payment method

| Metric | |
| - | |

@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