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

feat: Quick and dirty relation skipping #4755

Closed
wants to merge 26 commits into from
Closed

Conversation

Rumata888
Copy link
Contributor

@Rumata888 Rumata888 commented Feb 26, 2024

Introduces a mechanism to skip accumulating the result of a relation if by checking an appropriate selector we know that the relation is going to result in a zero. The mechanism works during both folding and sumcheck
Removes 3 seconds from the benchmark
image

@AztecBot
Copy link
Collaborator

AztecBot commented Feb 26, 2024

Benchmark results

Metrics with a significant change:

  • batch_insert_into_append_only_tree_16_depth_ms (8): 17.0 (+31%)
  • batch_insert_into_append_only_tree_16_depth_hash_ms (8): 0.722 (+31%)
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.

Values are compared against data from master at commit 13752339 and shown if the difference exceeds 1%.

L2 block published to L1

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

Metric 8 txs 32 txs 128 txs
l1_rollup_calldata_size_in_bytes 54,212 214,436 855,332
l1_rollup_calldata_gas 259,808 1,019,432 4,060,016
l1_rollup_execution_gas 353,994 1,138,880 4,281,417
l2_block_processing_time_in_ms 1,277 4,813 (+1%) 19,114 (+1%)
note_successful_decrypting_time_in_ms 223 (+2%) 608 (+1%) 2,198 (+2%)
note_trial_decrypting_time_in_ms 40.1 (+45%) 47.3 (+20%) 189 (+1%)
l2_block_building_time_in_ms 21,378 84,686 344,113
l2_block_rollup_simulation_time_in_ms 16,021 63,479 259,499
l2_block_public_tx_process_time_in_ms 5,328 (+1%) 21,129 (+1%) 84,354

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 16,558 (-1%) 29,285 (-9%)
note_history_successful_decrypting_time_in_ms 1,411 2,823 (+4%)
note_history_trial_decrypting_time_in_ms 173 (+7%) 244 (+8%)
node_database_size_in_bytes 18,681,936 36,098,128
pxe_database_size_in_bytes 29,923 59,478

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 333 44,664 27,457
private-kernel-ordering 214 45,777 14,627
base-rollup 1,744 175,344 933
root-rollup 83.9 (+1%) 4,192 825
private-kernel-inner 444 73,099 27,457
public-kernel-app-logic 275 32,254 25,379
merge-rollup 7.92 (+2%) 2,712 933

Tree insertion stats

The duration to insert a fixed batch of leaves into each tree type.

Metric 1 leaves 2 leaves 8 leaves 16 leaves 32 leaves 128 leaves 64 leaves 512 leaves 1024 leaves 2048 leaves 8192 leaves
batch_insert_into_append_only_tree_16_depth_ms 10.4 10.9 (+1%) ⚠️ 17.0 (+31%) 17.2 (+1%) 23.5 (+2%) 64.7 (+1%) N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_count 16.9 17.5 23.0 31.6 47.0 143 N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_ms 0.601 0.605 (+1%) ⚠️ 0.722 (+31%) 0.529 (+1%) 0.489 (+1%) 0.446 N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A N/A N/A N/A 75.6 (+1%) 48.3 242 467 922 (+2%) 3,611 (+1%)
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A N/A N/A N/A 159 96.0 543 1,055 2,079 8,223
batch_insert_into_append_only_tree_32_depth_hash_ms N/A N/A N/A N/A N/A 0.466 0.495 0.441 0.436 0.438 (+1%) 0.434 (+1%)
batch_insert_into_indexed_tree_20_depth_ms N/A N/A N/A N/A N/A 106 (+2%) 58.0 (+1%) 357 698 1,383 (+1%) 5,501
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A N/A N/A N/A 197 104 691 1,363 2,707 10,771
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A N/A N/A N/A 0.502 (+1%) 0.504 0.485 0.477 0.477 0.477
batch_insert_into_indexed_tree_40_depth_ms N/A N/A N/A N/A 65.3 (+1%) N/A N/A N/A N/A N/A N/A
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A N/A N/A 110 N/A N/A N/A N/A N/A N/A
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A N/A N/A 0.562 N/A N/A N/A N/A N/A N/A

Miscellaneous

Transaction sizes based on how many contracts are deployed in the tx.

Metric 0 deployed contracts 1 deployed contracts
tx_size_in_bytes 15,388 36,001

Transaction processing duration by data writes.

Metric 0 new note hashes 1 new note hashes
tx_pxe_processing_time_ms 577 (+1%) 1,505
Metric 0 public data writes 1 public data writes
tx_sequencer_processing_time_ms 0.0290 (-1%) 655

Base automatically changed from mm/pg-refactor-new to master February 29, 2024 12:36
@codygunton
Copy link
Contributor

For sumcheck functionality, this is replaced by #5766. IOU protogalaxy equivalent.

@codygunton codygunton closed this Apr 23, 2024
@ludamad ludamad deleted the is/skipping_relations branch August 22, 2024 14:18
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.

5 participants