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

fix: test dead instruction eliminator improvement #7806

Closed
wants to merge 5 commits into from

Conversation

sirasistant
Copy link
Collaborator

@sirasistant sirasistant commented Aug 7, 2024

Tests this pr noir-lang/noir#5691

Copy link
Contributor

github-actions bot commented Aug 7, 2024

Changes to circuit sizes

Generated at commit: 2f7b78f7c9583c234a38c88b6aa767a319794342, compared to commit: 5ff3554ace81831d0a561b6a4e186b48edb12e5e

🧾 Summary (100% most significant diffs)

Program ACIR opcodes (+/-) % Circuit size (+/-) %
public_kernel_app_logic +36 ❌ +0.01% +45 ❌ +0.01%
public_kernel_teardown +36 ❌ +0.01% +45 ❌ +0.00%
rollup_base +23 ❌ +0.01% +22 ❌ +0.00%
public_kernel_tail +9 ❌ +0.00% +9 ❌ +0.00%

Full diff report 👇
Program ACIR opcodes (+/-) % Circuit size (+/-) %
public_kernel_app_logic 294,492 (+36) +0.01% 596,033 (+45) +0.01%
public_kernel_teardown 296,102 (+36) +0.01% 1,657,207 (+45) +0.00%
rollup_base 344,449 (+23) +0.01% 8,608,959 (+22) +0.00%
public_kernel_tail 1,004,165 (+9) +0.00% 9,273,089 (+9) +0.00%

@AztecBot
Copy link
Collaborator

AztecBot commented Aug 7, 2024

Benchmark results

Metrics with a significant change:

  • protocol_circuit_simulation_time_in_ms (private-kernel-tail-to-public): 2,807 (-17%)
  • avm_simulation_time_ms (Token:_increase_public_balance): 10.8 (-86%)
  • avm_simulation_time_ms (FPC:pay_refund_with_shielded_rebate): 141 (+96%)
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,708 1,542 703 745 764 (-1%)
proof_construction_time_sha256_30_ms 11,710 (+2%) 3,134 (+1%) 1,405 (+1%) 1,451 (+2%) 1,461
proof_construction_time_sha256_100_ms 43,647 (+2%) 12,537 (+1%) 5,942 (+5%) 5,570 5,520
proof_construction_time_poseidon_hash_ms 78.0 34.0 34.0 57.0 (-5%) 86.0 (-2%)
proof_construction_time_poseidon_hash_30_ms 1,516 416 201 (+1%) 225 (+1%) 267 (+1%)
proof_construction_time_poseidon_hash_100_ms 5,598 (+1%) 1,509 681 (+1%) 725 751 (-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 740 740 740
l1_rollup_calldata_gas 6,716 6,718 6,692
l1_rollup_execution_gas 611,983 612,136 612,261
l2_block_processing_time_in_ms 238 (-2%) 461 801 (+1%)
l2_block_building_time_in_ms 9,570 18,687 (+1%) 37,104
l2_block_rollup_simulation_time_in_ms 9,569 18,687 (+1%) 37,104
l2_block_public_tx_process_time_in_ms 7,948 16,856 35,210

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 2,767 (-3%) 3,859 (-1%)
node_database_size_in_bytes 12,767,312 16,887,888
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 input_size_in_bytes output_size_in_bytes proving_time_in_ms proof_size_in_bytes num_public_inputs size_in_gates
private-kernel-init 103 (+9%) 393 (+1%) 21,846 44,858 N/A N/A N/A N/A
private-kernel-inner 168 (-4%) 690 (-1%) 72,545 45,005 N/A N/A N/A N/A
private-kernel-tail 678 (+1%) 817 (+2%) 53,216 50,574 N/A N/A N/A N/A
base-parity 5.92 595 160 96.0 1,738 13,188 19.0 65,536
root-parity 109 (+1%) 134 (+6%) 69,084 96.0 31,281 (-2%) 13,188 19.0 4,194,304
base-rollup 2,944 5,322 (-1%) 182,736 664 99,129 (+1%) 14,020 45.0 16,777,216
root-rollup 96.8 (+1%) 121 (+3%) 54,525 716 29,882 (+5%) 13,988 44.0 4,194,304
public-kernel-setup 91.0 (-2%) 2,839 103,513 70,710 17,878 (-2%) 128,708 3,629 2,097,152
public-kernel-app-logic 105 4,108 (-1%) 103,513 70,710 10,188 (-2%) 128,708 3,629 1,048,576
public-kernel-tail 576 (+1%) 27,494 (-10%) 403,238 11,326 103,415 (+1%) 27,204 457 16,777,216
private-kernel-reset-tiny 184 (+1%) 886 (+7%) 68,621 44,750 N/A N/A N/A N/A
private-kernel-tail-to-public ⚠️ 2,807 (-17%) 1,610 (+2%) 942,862 1,697 N/A N/A N/A N/A
public-kernel-teardown 87.5 (+1%) 4,158 103,513 70,710 18,695 (-4%) 128,708 3,629 2,097,152
merge-rollup 59.9 N/A 35,742 664 N/A N/A N/A N/A
undefined N/A N/A N/A N/A 68,859 (-2%) N/A N/A N/A

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
ContractClassRegisterer:register 1,344 11,731 340 (+1%) N/A N/A
ContractInstanceDeployer:deploy 1,408 11,731 18.1 (+1%) N/A N/A
MultiCallEntrypoint:entrypoint 1,920 11,731 477 (+1%) N/A N/A
FeeJuice:deploy 1,376 11,731 382 N/A N/A
SchnorrAccount:constructor 1,312 11,731 176 (+1%) N/A N/A
SchnorrAccount:entrypoint 2,304 11,731 537 N/A N/A
Token:privately_mint_private_note 1,280 11,731 219 (+1%) N/A N/A
FPC:fee_entrypoint_public 1,344 11,731 33.8 (+20%) N/A N/A
Token:transfer 1,312 11,731 454 (+3%) N/A N/A
AuthRegistry:set_authorized (avm) 18,491 N/A N/A 147,296 2,473 (-2%)
FPC:prepare_fee (avm) 22,958 N/A N/A 147,360 3,160 (-2%)
Token:transfer_public (avm) 61,614 N/A N/A 147,360 18,155
AuthRegistry:consume (avm) 41,719 N/A N/A 147,328 7,603 (-1%)
FPC:pay_refund (avm) 26,227 N/A N/A 147,328 7,437 (-2%)
Benchmarking:create_note 1,344 11,731 170 (+1%) N/A N/A
SchnorrAccount:verify_private_authwit 1,280 11,731 34.0 (+25%) N/A N/A
Token:unshield 1,376 11,731 739 N/A N/A
FPC:fee_entrypoint_private 1,376 11,731 967 (-1%) N/A N/A

AVM Simulation

Time to simulate various public functions in the AVM.

Function time_ms bytecode_size_in_bytes
FeeJuice:_increase_public_balance 96.3 (+1%) 8,139
FeeJuice:set_portal 10.0 2,362
Token:constructor 121 (+2%) 31,107
FPC:constructor 93.2 22,380
FeeJuice:mint_public 78.1 (+1%) 6,150
Token:mint_public 83.8 (+2%) 11,720
Token:assert_minter_and_mint 89.3 (+1%) 8,028
AuthRegistry:set_authorized 8.86 (-18%) 4,537
FPC:prepare_fee 297 8,812
Token:transfer_public 40.5 (-15%) 47,374
FPC:pay_refund 64.2 (+1%) 12,114
Benchmarking:increment_balance 1,010 7,450
Token:_increase_public_balance ⚠️ 10.8 (-86%) 8,960
FPC:pay_refund_with_shielded_rebate ⚠️ 141 (+96%) 12,663

Public DB Access

Time to access various public DBs.

Function time_ms
get-nullifier-index 0.162 (+3%)

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 2.17 (+1%) 3.90 (+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.112 (+1%) 0.110 N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A 11.1 18.1 (-3%) 30.4 (-4%) 61.7 111 (-1%)
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.107 (-1%) 0.105 (-2%) 0.0993 (-3%) 0.106 (-1%) 0.100 (-1%)
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 14.1 (-2%) 25.1 (-7%) 42.7 (-1%) 89.1 (+3%) 157 (-2%)
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.107 (-2%) 0.102 (-7%) 0.104 (-1%) 0.110 (+2%) 0.100 (-3%)
batch_insert_into_indexed_tree_40_depth_ms N/A N/A 16.8 N/A N/A N/A N/A
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A 132 N/A N/A N/A N/A
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A 0.107 (-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 63,593 665,008

Transaction size based on fee payment method

| Metric | |
| - | |

@vezenovm
Copy link
Contributor

Closing as noir-lang/noir#5691 was included in #7958

@vezenovm vezenovm closed this Aug 15, 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.

4 participants