barretenberg
barretenberg copied to clipboard
Perform precomputation for z_perm commitment to reduce memory peak
The method commit_structured_with_nonzero_complement
involves making a full copy of the srs points corresponding to the complement of the "active" region of the execution trace. These points are then summed into as many accumulators as there are blocks in the trace. This calculation only requires knowledge of the trace block utilization which is known after circuit finalization. It may be advantageous to move this precomputation to somewhere prior to the construction of the "point table" in the commitment key, which contains circuit_size * 2 many points (the raw SRS points plus the corresponding endomorphism points). This doesn't effect the efficiency or memory usage of the algorithm itself but it may effect peak memory if we don't need to store both the point table and the copied data in memory simultaneously.