Skip to content

Commit

Permalink
chore(contracts): increase optimizer runs to 10,000
Browse files Browse the repository at this point in the history
I observed a very small savings from increasing the optimizer runs,
and no noticable impact on compile time
  • Loading branch information
maurelian authored and smartcontracts committed Nov 10, 2021
1 parent 4391074 commit bf3929e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const config: HardhatUserConfig = {
{
version: '0.8.8',
settings: {
optimizer: { enabled: true, runs: 200 },
optimizer: { enabled: true, runs: 10_000 },
metadata: {
bytecodeHash: 'none',
},
Expand All @@ -75,7 +75,7 @@ const config: HardhatUserConfig = {
{
version: '0.5.17', // Required for WETH9
settings: {
optimizer: { enabled: true, runs: 200 },
optimizer: { enabled: true, runs: 10_000 },
outputSelection: {
'*': {
'*': ['storageLayout'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => {
'Non-calldata overhead gas cost per transaction:',
(gasUsed - fixedCalldataCost) / numTxs
)
expectApprox(gasUsed, 1_605_796, {
expectApprox(gasUsed, 1_604_975, {
upperPercentDeviation: 0,
// Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your
// contracts are too efficient, consider updating the target value!
Expand Down Expand Up @@ -211,7 +211,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => {
'Non-calldata overhead gas cost per transaction:',
(gasUsed - fixedCalldataCost) / numTxs
)
expectApprox(gasUsed, 1_739_811, {
expectApprox(gasUsed, 1_738_990, {
upperPercentDeviation: 0,
// Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your
// contracts are too efficient, consider updating the target value!
Expand Down Expand Up @@ -297,7 +297,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => {
console.log('Benchmark complete.')
console.log('Gas used:', gasUsed)

expectApprox(gasUsed, 217_615, {
expectApprox(gasUsed, 217_218, {
upperPercentDeviation: 0,
// Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your
// contracts are too efficient, consider updating the target value!
Expand All @@ -319,7 +319,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => {
console.log('Benchmark complete.')
console.log('Gas used:', gasUsed)

expectApprox(gasUsed, 156_711, {
expectApprox(gasUsed, 156_314, {
upperPercentDeviation: 0,
// Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your
// contracts are too efficient, consider updating the target value!
Expand Down

0 comments on commit bf3929e

Please sign in to comment.