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

refactor: unify Zero / Empty to Default + refactor away from std::unsafe::zeroed() (nr part) #5662

Conversation

sklppy88
Copy link
Contributor

No description provided.

@sklppy88 sklppy88 marked this pull request as ready for review April 10, 2024 13:44
sklppy88 and others added 2 commits April 10, 2024 14:39
@AztecBot
Copy link
Collaborator

AztecBot commented Apr 10, 2024

Benchmark results

Metrics with a significant change:

  • note_successful_decrypting_time_in_ms (8): 249 (+22%)
  • note_trial_decrypting_time_in_ms (32): 95.6 (+187%)
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.

L2 block published to L1

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

Metric 8 txs 32 txs 64 txs
l1_rollup_calldata_size_in_bytes 676 676 676
l1_rollup_calldata_gas 6,400 6,400 6,424
l1_rollup_execution_gas 585,733 585,733 585,757
l2_block_processing_time_in_ms 1,291 (-1%) 4,737 (-2%) 9,195 (-2%)
note_successful_decrypting_time_in_ms ⚠️ 249 (+22%) 490 (-6%) 857 (-9%)
note_trial_decrypting_time_in_ms 59.3 (-25%) ⚠️ 95.6 (+187%) 76.0 (+20%)
l2_block_building_time_in_ms 10,146 (-3%) 35,656 (-4%) 70,787 (-4%)
l2_block_rollup_simulation_time_in_ms 10,031 (-3%) 35,277 (-4%) 70,062 (-4%)
l2_block_public_tx_process_time_in_ms 4,726 (-4%) 18,391 (-5%) 36,894 (-5%)

L2 chain processing

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

Metric 5 blocks 10 blocks
node_history_sync_time_in_ms 13,373 (-3%) 25,866 (-4%)
note_history_successful_decrypting_time_in_ms 1,103 (-10%) 2,147 (-3%)
note_history_trial_decrypting_time_in_ms 37.1 (-22%) 79.2 (-9%)
node_database_size_in_bytes 18,600,016 34,955,344
pxe_database_size_in_bytes 29,859 59,414

Circuits stats

Stats on running time and I/O sizes collected for every circuit run across all benchmarks.

Circuit circuit_simulation_time_in_ms circuit_input_size_in_bytes circuit_output_size_in_bytes
private-kernel-init 139 (-5%) 44,281 26,164
private-kernel-inner 146 (-5%) 71,648 26,164
private-kernel-ordering 107 (-6%) 50,830 39,026
base-parity 3,730 (-5%) 128 311
root-parity 1,062 1,244 311
base-rollup 12,909 (-3%) 110,464 861
root-rollup 48.3 (-2%) 4,359 725
public-kernel-app-logic 76.6 (-5%) 47,599 40,661
public-kernel-tail 108 (-6%) 53,372 7,125
merge-rollup 9.00 (-14%) 2,568 861
public-kernel-teardown 75.8 (-3%) 47,599 40,661
public-kernel-setup 74.8 (-3%) 47,599 40,661

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 512 leaves 1024 leaves 2048 leaves 4096 leaves 32 leaves
batch_insert_into_append_only_tree_16_depth_ms 9.73 (-3%) 15.7 (-2%) N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_count 16.8 31.6 N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_ms 0.568 (-3%) 0.486 (-2%) N/A 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 44.6 (-3%) 71.2 (-2%) 224 (-3%) 430 (-3%) 839 (-5%) 1,754 N/A
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A 96.0 159 543 1,055 2,079 4,127 N/A
batch_insert_into_append_only_tree_32_depth_hash_ms N/A N/A 0.457 (-3%) 0.439 (-2%) 0.408 (-4%) 0.402 (-3%) 0.399 (-4%) 0.418 N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 53.0 (-2%) 104 (-3%) 327 (-3%) 636 (-4%) 1,263 (-4%) 2,525 (-4%) N/A
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 105 207 691 1,363 2,707 5,395 N/A
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.469 (-2%) 0.470 (-3%) 0.444 (-3%) 0.438 (-4%) 0.438 (-4%) 0.440 (-3%) N/A
batch_insert_into_indexed_tree_40_depth_ms N/A N/A N/A N/A N/A N/A N/A N/A 59.1 (-3%)
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A N/A N/A N/A N/A N/A N/A 109
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A N/A N/A N/A N/A N/A N/A 0.517 (-3%)

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 40,372 496,534

Transaction size based on fee payment method

Metric native fee payment method fpc_public fee payment method fpc_private fee payment method
tx_with_fee_size_in_bytes 905 1,161 1,377

Transaction processing duration by data writes.

Metric 0 new note hashes 1 new note hashes 2 new note hashes
tx_pxe_processing_time_ms 1,162 (-2%) 785 (-5%) 3,998
Metric 1 public data writes 2 public data writes 3 public data writes 4 public data writes 5 public data writes 8 public data writes
tx_sequencer_processing_time_ms 404 (-5%) 284 (-5%) 734 (-4%) 366 (-4%) 1,199 (-4%) 427 (-4%)

Copy link
Contributor

benesjan commented Apr 11, 2024

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

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

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

@sklppy88 sklppy88 closed this Apr 11, 2024
@sklppy88 sklppy88 deleted the ek/refactor/unify-zero-empty-to-default-nr-p4 branch April 11, 2024 09:49
@sklppy88
Copy link
Contributor Author

Closed in favor of #5685

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.

3 participants