v4-core
v4-core copied to clipboard
Optimise `_checkProtocolFee`
Related Issue
Gas Optimisation
Description of changes
1.Introduced unchecked block for the _checkProtocolFee() function , this potentially saves 100+ in gas 2.Performed modulo operation using bit operation this saves 25+ in gas, for more information check http://graphics.stanford.edu/~seander/bithacks.html#ModulusDivisionEasy 3.used uint256 as param type instead of uint8
will do that
@hensha256 done
Hi @malik672 the snapshots are showing that there arent any gas improvements from your code changes? Only the bytecode size has changed
Hi @malik672 the snapshots are showing that there arent any gas improvements from your code changes? Only the bytecode size has changed
this is weird, there should be gas decrease
We have now made a number of changes for how protocol fees work so this PR is out of date. We are closing this PR in favor of #283