Open ahamlat opened 1 week ago
In https://github.com/Consensys/linea-arithmetization/pull/748/commits/5413f169ecadf223237d8f398b2e20c148022109 I modified the default nb of line to 22, which is the max in the arith. We have to give better limits for each instructions:
Currently, in TraceSection.java, the number of lines is initialized to 32, this generates a lot of overhead on big transactions that have hundreds of thousands of TraceSection objects. I suggest to limit the size of the arrayList lines to the expected maximum size.
Currently
List<TraceLine> lines = new ArrayList<>(32);
Expected
List<TraceLine> lines = new ArrayList<>(target_size);
I did some tests with Java Object Layout to show the difference between initializing the arrayList without any size, with the expected size (in this case 5) and with 32. The results shows a difference of 112 bytes difference in the shallow size of each lines object between the the current implementation (size = 32) and the implementation where we would set the size to 4.
The testing code
The result