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

test(avm): minor benchmarking #9869

Open
wants to merge 10 commits into
base: ir/11-03-feat_avm_ephmeral_avm_tree
Choose a base branch
from

Conversation

IlyasRidhuan
Copy link
Contributor

@IlyasRidhuan IlyasRidhuan commented Nov 10, 2024

Just a very small micro-benchmark for the a future PR to reference.

This sets up the smallest "worst-case" scenario for the current ephmeral tree implementation.

  1. An initial public data tree is seeded with 128 dummy leaves, occupying slots 0 to 127
  2. We update slot 0 with a new value - this causes the ephemeral tree to track slot 0 as the indexedTreeMin.
  3. Inserting 64 new slots (as per a tx), results in 126 DB accesses and a linear (in the leaf count) search complexity
    a) The DB reads occur because the ephemeral tree doesnt track slots 1 to 127
    b) All reads are O(n) as we traverse from min leaf to the low leaf info

Copy link
Contributor Author

IlyasRidhuan commented Nov 10, 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.

@IlyasRidhuan IlyasRidhuan force-pushed the ir/11-03-feat_avm_ephmeral_avm_tree branch from 4c99c3d to d158b08 Compare November 12, 2024 13:57
@IlyasRidhuan IlyasRidhuan force-pushed the ir/11-10-perf_avm_minor_benchmarking branch from fc15d18 to b57b5e9 Compare November 12, 2024 13:57
@IlyasRidhuan IlyasRidhuan force-pushed the ir/11-03-feat_avm_ephmeral_avm_tree branch from d158b08 to 62c4e45 Compare November 12, 2024 14:41
@IlyasRidhuan IlyasRidhuan force-pushed the ir/11-10-perf_avm_minor_benchmarking branch from b57b5e9 to 060057e Compare November 12, 2024 14:42
@IlyasRidhuan IlyasRidhuan force-pushed the ir/11-03-feat_avm_ephmeral_avm_tree branch from 62c4e45 to da0ecb5 Compare November 12, 2024 15:50
@IlyasRidhuan IlyasRidhuan force-pushed the ir/11-10-perf_avm_minor_benchmarking branch from 060057e to ee830d6 Compare November 12, 2024 15:50
@IlyasRidhuan IlyasRidhuan changed the title perf(avm): minor benchmarking test(avm): minor benchmarking Nov 12, 2024
@IlyasRidhuan IlyasRidhuan marked this pull request as ready for review November 12, 2024 19:06
@IlyasRidhuan IlyasRidhuan force-pushed the ir/11-03-feat_avm_ephmeral_avm_tree branch from da0ecb5 to 13e10c1 Compare November 13, 2024 00:57
@IlyasRidhuan IlyasRidhuan force-pushed the ir/11-10-perf_avm_minor_benchmarking branch from ee830d6 to 5fe6ae7 Compare November 13, 2024 00:57
Copy link
Contributor

github-actions bot commented Nov 13, 2024

Changes to public function bytecode sizes

Generated at commit: 8e4e5eb86ed0ed7f6446f66ec7a36cad35089127, compared to commit: 13e10c1c22498b8af6a0c23f37910fdfaa32e13b

🧾 Summary (100% most significant diffs)

Program Bytecode size in bytes (+/-) %
Token::public_dispatch -2,716 ✅ -7.36%

Full diff report 👇
Program Bytecode size in bytes (+/-) %
Token::public_dispatch 34,189 (-2,716) -7.36%

@IlyasRidhuan IlyasRidhuan force-pushed the ir/11-03-feat_avm_ephmeral_avm_tree branch from 13e10c1 to d9eecce Compare November 13, 2024 15:49
@IlyasRidhuan IlyasRidhuan force-pushed the ir/11-10-perf_avm_minor_benchmarking branch from 5fe6ae7 to 1dad3c0 Compare November 13, 2024 15:49
Copy link
Contributor

Changes to circuit sizes

Generated at commit: 8e4e5eb86ed0ed7f6446f66ec7a36cad35089127, compared to commit: 13e10c1c22498b8af6a0c23f37910fdfaa32e13b

🧾 Summary (100% most significant diffs)

Program ACIR opcodes (+/-) % Circuit size (+/-) %
private_kernel_init +23 ❌ +0.11% +21 ❌ +0.06%
private_kernel_inner +26 ❌ +0.07% +22 ❌ +0.04%
private_kernel_tail +3 ❌ +0.07% +3 ❌ +0.02%
parity_base +3 ❌ +0.07% +3 ❌ +0.01%
private_kernel_tail_to_public +3 ❌ +0.02% +3 ❌ +0.01%
private_kernel_reset_4_4_4_4_4_4_4_4_1 +1 ❌ +0.00% +1 ❌ +0.00%
rollup_base_public +40 ❌ +0.01% +42 ❌ +0.00%
rollup_base_private +38 ❌ +0.01% +38 ❌ +0.00%
rollup_merge +4 ❌ +0.12% +4 ❌ +0.00%
rollup_root +4 ❌ +0.03% +4 ❌ +0.00%
rollup_block_merge +4 ❌ +0.03% +4 ❌ +0.00%
private_kernel_reset +1 ❌ +0.00% +1 ❌ +0.00%
rollup_block_root +4 ❌ +0.09% +4 ❌ +0.00%
parity_root +3 ❌ +0.06% +3 ❌ +0.00%

Full diff report 👇
Program ACIR opcodes (+/-) % Circuit size (+/-) %
private_kernel_init 21,726 (+23) +0.11% 34,887 (+21) +0.06%
private_kernel_inner 38,093 (+26) +0.07% 57,530 (+22) +0.04%
private_kernel_tail 4,493 (+3) +0.07% 13,045 (+3) +0.02%
parity_base 4,301 (+3) +0.07% 30,698 (+3) +0.01%
private_kernel_tail_to_public 18,852 (+3) +0.02% 31,300 (+3) +0.01%
private_kernel_reset_4_4_4_4_4_4_4_4_1 32,455 (+1) +0.00% 86,600 (+1) +0.00%
rollup_base_public 470,092 (+40) +0.01% 3,770,598 (+42) +0.00%
rollup_base_private 332,907 (+38) +0.01% 3,432,553 (+38) +0.00%
rollup_merge 3,419 (+4) +0.12% 1,909,446 (+4) +0.00%
rollup_root 11,989 (+4) +0.03% 1,940,906 (+4) +0.00%
rollup_block_merge 12,005 (+4) +0.03% 1,940,920 (+4) +0.00%
private_kernel_reset 84,097 (+1) +0.00% 618,117 (+1) +0.00%
rollup_block_root 4,489 (+4) +0.09% 2,863,252 (+4) +0.00%
parity_root 5,034 (+3) +0.06% 3,801,552 (+3) +0.00%

@IlyasRidhuan IlyasRidhuan force-pushed the ir/11-03-feat_avm_ephmeral_avm_tree branch from d9eecce to f152568 Compare November 14, 2024 21:29
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.

2 participants