Skip to main content

What Is the Performance Impact of the Compiler’s Built-in Checks?

The performance impact of the compiler's built-in checks is a slight, but measurable, increase in gas cost compared to completely unchecked arithmetic in older Solidity versions. The compiler inserts opcodes to perform the necessary checks before and after each arithmetic operation.

However, this overhead is considered a necessary and small price for the massive security gain, as it eliminates an entire class of catastrophic financial vulnerabilities by default.

How Does EIP-1884 Relate to the Gas Costs of External Calls?
How Can a Developer Intentionally Disable the Overflow Checks in Solidity 0.8.0?
How Does the EVM Calculate the Gas Cost of a Specific Operation?
What Is the Role of the Solidity Compiler in Mitigating Integer Vulnerabilities?