Gas Optimizations #111
Labels
bug
Something isn't working
G (Gas Optimization)
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
G-01:
use uint256 for best gas saving
ClearingHouse.sol L#17,18,19,20
MarginAccount.sol L#47
G-02:
uint256 instead of bool
ClearingHouse.sol L#79,250
G-04:
Prefix increments are cheaper than postfix increments.
Further more, using unchecked {++x} is even more gas efficient, and the gas saving accumulates every iteration and can make a real change
ClearingHouse.sol L#122,130,170,194,251,263,278
MarginAccount.sol L#331,373,521
G-05:
immutable instead of constant
MarginAccount.sol L#34,15,
G-06:
use calldata instead of memory
G-07:
use memory instead of storage
G-03:
bytes32 instead of string
The text was updated successfully, but these errors were encountered: