You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This function is a no-op if rho == now. Rather than wasting a bunch of effort (gas) executing this function in that case, it should just return early. While the caller can do if (pot.rho != now) pot.drip(), it is much more expensive for them to do this than it is for this method to do that.
The text was updated successfully, but these errors were encountered:
This proposed optimization seems especially impactful as each run executes 5 SSTOREs (all rewriting the same value after either adding 0 or multiplying by 1) and many more SLOADs.
The if statement @MicahZoltu is proposing would save over 30K gas per call.
dss/src/pot.sol
Line 138 in effdda3
This function is a no-op if
rho == now
. Rather than wasting a bunch of effort (gas) executing this function in that case, it should just return early. While the caller can doif (pot.rho != now) pot.drip()
, it is much more expensive for them to do this than it is for this method to do that.The text was updated successfully, but these errors were encountered: