Benchmarks against Solidity Runtime size, deployment gas and individual calls for the four teaching contracts, compared with solc on the same workloads.
Counter, Token, Pool and Lending each have a Solidity equivalent. The suite deploys each implementation on hevm (Osaka), then sends it the same sequence of transactions. Pool calls two tokens; Lending also depends on a reward token and a price oracle. The Solidity compiler is solc 0.8.33, with optimization at 200 runs and no CBOR metadata. The via-IR pipeline is the baseline for ratios.
Execution gas is the gas a transaction uses before refunds and the EIP-7623 floor, less its intrinsic gas. Deployment gas includes every transaction needed to install the contract; runtime bytes include every account created by installation. A mean is specific to the steps shown, not a guarantee about future calls. Matching ABI data is checked for status, output and logs against both Solidity pipelines. Native calls may have a different encoding.
just evm-benchmarks --teaching prints the tables below. The full compiler comparison also records specialized regression workloads.
Example Equivalent Omegyu bytes solc via-IR bytes Ratio Omegyu installation Omegyu deployment gas solc via-IR deployment gas Mean native ÷ via-IR Mean ABI ÷ via-IR Counter exact 815 419 1.95 one contract 232,336 147,503 1.00 1.01 Token exact 2,825 1,339 2.11 one contract 711,171 391,338 0.92 0.96 Pool exact 4,768 2,270 2.10 one contract 1,083,705 545,105 0.94 0.96 Lending exact 23,121 6,809 3.40 one contract 5,063,228 1,576,861 0.93 0.94
Step Status Native ABI solc via-IR solc legacy Native ÷ via-IR ABI ÷ via-IR increment, from 0 (first write) ok 22,233 22,233 22,328 22,311 1.00 1.00 increment, from 1 ok 5,133 5,133 5,228 5,211 0.98 0.98 add 5 ok 5,239 5,335 5,247 5,368 1.00 1.02 addTimes 5, 3 times ok 5,317 5,406 5,371 5,555 0.99 1.01 addTimes 5, 0 times ok 2,517 2,606 2,571 2,755 0.98 1.01 addAll of 3 words ok 5,784 — 5,807 6,063 1.00 — addAll of no words ok 2,645 — 2,596 2,732 1.02 — count ok 2,239 2,274 2,247 2,259 1.00 1.01 add, overflow (Panic) revert 2,420 2,458 2,341 2,417 1.03 1.05 arithmetic mean 1.00 1.01 geometric mean 1.00 1.01
Step Status Native ABI solc via-IR solc legacy Native ÷ via-IR ABI ÷ via-IR mint 100 to a new holder, by the owner ok 28,900 29,292 29,383 29,471 0.98 1.00 mint, not by the owner (Unauthorized) revert 340 350 373 401 0.91 0.94 transfer 10 to a holder ok 11,807 12,255 12,506 12,641 0.94 0.98 transfer 10 to a new holder ok 28,907 29,355 29,606 29,741 0.98 0.99 transfer, insufficient balance revert 2,503 2,534 2,663 2,746 0.94 0.95 transferRaw 10 to a holder ok 11,710 — 12,466 12,549 0.94 — approve 50, a new allowance ok 23,936 24,365 24,305 24,519 0.98 1.00 approve 60, an allowance again ok 6,836 7,265 7,205 7,419 0.95 1.01 transferFrom 20, by the spender ok 17,009 17,484 17,824 18,118 0.95 0.98 transferFrom, insufficient allowance revert 2,642 2,692 2,669 2,861 0.99 1.01 balanceOf ok 2,359 2,452 2,529 2,541 0.93 0.97 allowance ok 2,493 2,596 2,782 2,799 0.90 0.93 totalSupply ok 2,283 2,347 2,292 2,339 1.00 1.02 decimals (an immutable) ok 213 269 239 292 0.89 1.13 name ok 328 334 380 379 0.86 0.88 symbol ok 308 354 545 433 0.57 0.65 arithmetic mean 0.92 0.96 geometric mean 0.91 0.96
Step Status Native ABI solc via-IR solc legacy Native ÷ via-IR ABI ÷ via-IR addLiquidity, first deposit ok 139,512 139,794 140,643 140,869 0.99 0.99 swapExact0For1 10^6 ok 41,030 41,765 42,166 42,545 0.97 0.99 swapExact1For0 10^6 ok 40,977 41,766 42,237 42,593 0.97 0.99 swap, slippage (Slippage) revert 2,859 2,903 3,029 3,375 0.94 0.96 addLiquidity 10^6 and 4 * 10^6 ok 53,823 54,096 54,441 54,587 0.99 0.99 removeLiquidity 10^6 shares ok 48,781 49,295 49,820 49,824 0.98 0.99 removeLiquidity, without shares (NoShares) revert 4,816 4,886 7,156 7,279 0.67 0.68 getReserves ok 2,337 2,377 2,334 2,475 1.00 1.02 sharesOf ok 2,335 2,452 2,495 2,582 0.94 0.98 totalShares ok 2,240 2,297 2,338 2,316 0.96 0.98 arithmetic mean 0.94 0.96 geometric mean 0.94 0.95
Step Status Native ABI solc via-IR solc legacy Native ÷ via-IR ABI ÷ via-IR supply 10^24, the first supplier ok 84,185 84,705 87,822 87,719 0.96 0.96 supply 5 * 10^23, a second supplier ok 57,736 58,251 59,310 59,769 0.97 0.98 supply, zero assets (ZeroAssets) revert 583 654 994 917 0.59 0.66 supplyCollateral 10^21 ok 59,340 59,799 60,393 60,528 0.98 0.99 borrow 10^21, the first borrow ok 67,386 67,859 69,289 70,132 0.97 0.98 accrueInterest a day later ok 18,249 18,240 18,864 19,328 0.97 0.97 accrueInterest again, in the same block ok 2,798 2,788 7,567 7,469 0.37 0.37 borrow 2 * 10^20 more, an hour later ok 53,086 53,559 54,989 55,832 0.97 0.97 borrow beyond the threshold (Unhealthy) revert 35,852 35,887 37,116 37,953 0.97 0.97 repay 5 * 10^26 shares ok 50,232 50,702 51,676 52,693 0.97 0.98 withdraw 10^23 ok 41,024 41,486 42,217 43,081 0.97 0.98 withdraw more than supplied (InsufficientShares) revert 20,566 20,579 21,066 21,930 0.98 0.98 withdrawCollateral 10^20, still healthy ok 45,579 46,024 47,248 47,858 0.96 0.97 withdrawCollateral beyond the threshold (Unhealthy) revert 28,649 28,705 29,694 30,305 0.96 0.97 setFee 10%, by the owner ok 19,560 19,591 20,125 20,789 0.97 0.97 setFee, not by the owner (Unauthorized) revert 577 595 652 713 0.88 0.91 setRewardRate 10^15 a second ok 43,812 43,860 44,499 45,219 0.98 0.99 accrueInterest a week later, with the fee ok 47,573 47,564 48,287 48,708 0.99 0.99 claimRewards ok 91,323 91,822 113,139 113,668 0.81 0.81 pendingRewards ok 13,321 13,445 13,364 13,848 1.00 1.01 market ok 6,777 6,914 6,763 6,785 1.00 1.02 position ok 4,557 4,643 4,869 4,854 0.94 0.95 borrowRate ok 4,684 4,655 4,850 4,746 0.97 0.96 isHealthy, healthy ok 14,598 14,657 15,425 15,909 0.95 0.95 liquidate a healthy position (Healthy) revert 38,014 38,041 38,845 39,438 0.98 0.98 isHealthy, after the price falls ok 14,598 14,657 15,425 15,909 0.95 0.95 liquidate 10^20 of collateral ok 105,296 105,802 107,365 107,938 0.98 0.99 liquidate more than the collateral (InsufficientCollateral) revert 38,039 38,065 38,867 39,482 0.98 0.98 liquidate all the collateral, with bad debt ok 88,228 88,734 90,602 91,053 0.97 0.98 position after the bad debt ok 4,557 4,643 4,869 4,854 0.94 0.95 setFeeRecipient ok 23,742 23,936 24,762 25,250 0.96 0.97 supply 10^22 after the bad debt, an hour later ok 45,655 46,170 47,233 47,684 0.97 0.98 arithmetic mean 0.93 0.94 geometric mean 0.92 0.93
PreviousChecked, tested and assumed