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: bb faster init #2776

Merged
merged 11 commits into from
Oct 11, 2023
Merged

feat: bb faster init #2776

merged 11 commits into from
Oct 11, 2023

Conversation

charlielye
Copy link
Contributor

Faster init. At least in most cases. It builds the circuit first, to determine number of gates, then only loads the amount of CRS actually needed. This speeds up startup time a lot.

The tradeoff however is that for larger circuits you may spend a lot of time building the circuit, at which point you'd have been faster just ripping in the whole CRS. Still, for most of our cases right now this is the better option.

@charlielye charlielye changed the base branch from master to cl/clangd_owning October 10, 2023 20:17
@charlielye charlielye requested a review from kevaundray October 10, 2023 20:17
Base automatically changed from cl/clangd_owning to master October 11, 2023 09:57
@charlielye charlielye merged commit c794533 into master Oct 11, 2023
@charlielye charlielye deleted the cl/bb_faster_init branch October 11, 2023 11:54
@AztecBot
Copy link
Collaborator

Benchmark 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.

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 45444 179588 716132
l1_rollup_calldata_gas 222984 867896 3449444
l1_rollup_execution_gas 842071 3595004 22204813
l2_block_processing_time_in_ms 1030 3938 15483
note_successful_decrypting_time_in_ms 329 1008 3737
note_trial_decrypting_time_in_ms 32 107 138
l2_block_building_time_in_ms 8976 36065 149394
l2_block_rollup_simulation_time_in_ms 6651 26725 105602
l2_block_public_tx_process_time_in_ms 2286 9213 42980

L2 chain processing

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

Metric 10 blocks 20 blocks 30 blocks
node_history_sync_time_in_ms 32088 77913 139870
note_history_successful_decrypting_time_in_ms 4877 13573 20706
note_history_trial_decrypting_time_in_ms 146 264 283
node_database_size_in_bytes 1192773 1899443 2755113
pxe_database_size_in_bytes 54187 108338 162578

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 56.10889570552147 56577 14745
private-kernel-ordering 30.312116564417177 20137 8089
base-rollup 870 631604 810
root-rollup 38.1219512195122 4072 1097
private-kernel-inner 52.18132716049383 72288 14745
public-kernel-private-input 51.93441358024691 37359 14745
public-kernel-non-first-iteration 31.192901234567902 37401 14745
merge-rollup 0.9651162790697675 2592 873

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants