balancer / balancer-v3-monorepo

GNU General Public License v3.0
30 stars 7 forks source link

add optimization for copyToScale function when memory array double init #696

Closed elshan-eth closed 3 weeks ago

elshan-eth commented 1 month ago

Description

We can save gas if we don't create a new array when we use copyToScale... functions. With this PR we can reuse this array.

Type of change

Checklist:

Issue Resolution

Closes #336

elshan-eth commented 3 weeks ago

no optimization. It seems that before the main update, it reduced the gas by 300 in all cases but now I see that this only works for PoolMock