Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Add bytecode benchmark #20

Closed
wants to merge 20 commits into from
Closed

Add bytecode benchmark #20

wants to merge 20 commits into from

Conversation

smtmfft
Copy link
Collaborator

@smtmfft smtmfft commented Sep 20, 2022

To resolve privacy-scaling-explorations#666

Reuse BytecodeCircuitTester to avoid more dup code.

smtmfft and others added 2 commits September 19, 2022 07:18
Signed-off-by: smtmfft <smtmfft@taikocha.in>
Signed-off-by: smtmfft <smtm@taiko.xzy>
smtmfft added 2 commits September 20, 2022 08:02
Signed-off-by: smtmfft <smtm@taiko.xzy>
Signed-off-by: smtmfft <smtm@taiko.xzy>
Signed-off-by: smtmfft <smtm@taiko.xzy>
smtmfft added 2 commits September 21, 2022 10:16
Signed-off-by: smtmfft <smtm@taiko.xzy>
Signed-off-by: smtmfft <smtm@taiko.xzy>
Comment on lines 33 to 36
let bytecodes_len: u32 = var("BTYECODES_LEN")
.unwrap_or_else(|_| "1".to_string())
.parse()
.expect("Cannot parse BTYECODES_LEN env var as u32");

Choose a reason for hiding this comment

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

Not sure I understand the purpose of this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

bytecode_circuit absorbs bytecode array, i.e., 1 or N bytecodes. To make a full data table, we can either use 1 large bytecode or N small bytecode to fill up the 2^k rows. This variable is created for these 2 cases, although they actually makes little difference.

smtmfft added 3 commits September 23, 2022 04:08
Signed-off-by: smtmfft <smtm@taiko.xzy>
Signed-off-by: smtmfft <smtm@taiko.xzy>
Signed-off-by: smtmfft <smtm@taiko.xzy>
Comment on lines 121 to 128
if bytecodes_num == 0 {
vec![]
} else {
assert!(bytecode_len >= 1);
(0..bytecodes_num * bytecode_len)
.collect::<Vec<usize>>()
.chunks(bytecode_len)
.map(|idx_range| {

Choose a reason for hiding this comment

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

Simple for loop makes ,more sense here? Because you do bytecodes_num * bytecode_len and then create chunks of bytecode_len, so may as well just use some loops?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, only diff is the value sequence, changed to for_each loop and make the fillup logic simpler.

smtmfft added 6 commits September 27, 2022 07:35
Signed-off-by: smtmfft <smtm@taiko.xzy>
Signed-off-by: smtmfft <smtm@taiko.xzy>
Signed-off-by: smtmfft <smtm@taiko.xzy>
Signed-off-by: smtmfft <smtm@taiko.xzy>
Signed-off-by: smtmfft <smtm@taiko.xzy>
Signed-off-by: smtmfft <smtm@taiko.xzy>
@smtmfft smtmfft closed this Oct 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add missing circuits to benchmarks
2 participants