Closed molly-ting closed 11 months ago
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Moving loop invariant codes out from loop can save gas. In the following demo, it can save 265 units of gas when the length of
arr
is 100.Initializing variables before the loop instead of inside the loop can also save gas. In the example below, function test4 consumes 553 units less gas than function test3 when the length of arr is 100.