[Solidity] The impact of variable ordering on gas

Yi-Cyuan Chen
Sep 11, 2018

--

We moved! Find the content on the new site! πŸ‘ˆ

You may not know that the order of declaration of variables will also affect the consumption of Gas.

Since the EVM operations are all performed in units of 32 bytes, the compiler will attempt to package the variables into a 32 bytes set for access, so as to reduce access times.

…

--

--