-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Labels
Description
Depends on #1233.
Each call to get_output involves calling dup on the circuit outputs. Right now, this implies cloning the entire array. We should implement a reference counting mechanism instead to avoid this.
let outputs = circuit_data
.eval(modulus)
.unwrap();
outputs.get_output(add2);
outputs.get_output(add2);
outputs.get_output(add2);
outputs.get_output(add2);
outputs.get_output(add2);The reference counting would be quite simple:
- On
dup, increment the reference counter. - On
drop, decrease the reference counter and free if last reference.
The reference counter should be shared between all instances, and therefore should be saved inside the allocation, like we do with regular arrays.
Q: How much code can be reused from the current array implementation?
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
In Review