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: Brillig IR refactor #5233

Merged
merged 12 commits into from
Mar 15, 2024
Merged

feat: Brillig IR refactor #5233

merged 12 commits into from
Mar 15, 2024

Conversation

sirasistant
Copy link
Collaborator

@sirasistant sirasistant commented Mar 15, 2024

Split brillig IR in low level instructions and higher level codegen files that compose the instructions and restrict visibilities. This should not have any business logic change. This also fixes debug_show by only printing the low level instructions, previously we were printing both the high level codegen and the low level instructions and it was a mess to read.

@sirasistant sirasistant marked this pull request as ready for review March 15, 2024 10:03
@AztecBot
Copy link
Collaborator

AztecBot commented Mar 15, 2024

Benchmark results

No metrics with a significant change found.

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 2e634796 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 64 txs
l1_rollup_calldata_size_in_bytes 5,668 18,820 36,356
l1_rollup_calldata_gas 66,388 239,044 468,968
l1_rollup_execution_gas 667,069 953,954 1,336,325
l2_block_processing_time_in_ms 1,296 (-1%) 4,788 (-1%) 8,970
note_successful_decrypting_time_in_ms 149 (-29%) 502 (+3%) 972 (+3%)
note_trial_decrypting_time_in_ms 27.1 (+53%) 115 (+10%) 102 (+39%)
l2_block_building_time_in_ms 18,726 (+2%) 69,909 138,810
l2_block_rollup_simulation_time_in_ms 8,295 (+1%) 28,944 (-1%) 56,911
l2_block_public_tx_process_time_in_ms 10,410 (+2%) 40,904 81,799

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,887 (-9%) 26,346 (+4%)
note_history_successful_decrypting_time_in_ms 1,235 (-11%) 2,492 (+5%)
note_history_trial_decrypting_time_in_ms 68.8 (-54%) 158 (+32%)
node_database_size_in_bytes 19,083,344 35,598,416 (-1%)
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 286 (-3%) 44,370 27,700
private-kernel-ordering 219 (-4%) 52,324 14,326
base-parity 1,955 (+5%) 128 311
base-rollup 726 177,083 925
root-parity 1,369 (-14%) 1,244 311
root-rollup 69.7 4,487 789
private-kernel-inner 646 (-3%) 73,229 27,700
public-kernel-app-logic 453 (-2%) 35,262 28,215
public-kernel-tail 178 (-1%) 40,926 28,215
merge-rollup 8.44 (+2%) 2,696 925

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.97 (-2%) 15.9 (-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.581 (-2%) 0.493 (-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 46.0 (-1%) 71.6 (-4%) 230 (-1%) 444 (-4%) 867 1,716 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.472 (-1%) 0.442 (-4%) 0.419 (-1%) 0.415 (-4%) 0.413 0.410 N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 53.6 (-1%) 106 (-2%) 335 659 (-3%) 1,311 2,607 N/A
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 104 207 691 1,363 2,707 5,395 N/A
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.477 (-1%) 0.478 (-2%) 0.456 0.454 (-3%) 0.454 0.452 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 61.1 (-2%)
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.536 (-1%)

Miscellaneous

Transaction sizes based on how many contract classes are registered in the tx.

Metric 0 registered classes
tx_size_in_bytes 22,014

Transaction processing duration by data writes.

Metric 0 new note hashes 1 new note hashes
tx_pxe_processing_time_ms 3,292 (-2%) 1,764 (-3%)
Metric 0 public data writes 1 public data writes
tx_sequencer_processing_time_ms 13.0 (-2%) 1,267 (-1%)

Copy link
Contributor

@kevaundray kevaundray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM -- a nit regarding a legend was discussed on slack, but not blocking

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