Skip to content

First draft of sol vs fe gas benchmarking#1316

Draft
cburgdorf wants to merge 1 commit intoargotorg:masterfrom
cburgdorf:fe-bench
Draft

First draft of sol vs fe gas benchmarking#1316
cburgdorf wants to merge 1 commit intoargotorg:masterfrom
cburgdorf:fe-bench

Conversation

@cburgdorf
Copy link
Copy Markdown
Collaborator

@cburgdorf cburgdorf commented Mar 3, 2026

$ ./target/debug/fe bench
Found 4 benchmark fixture(s)

--- bitwise_u256 ---
--- loops ---
--- math_u256 ---
--- storage_simple ---
Fixture              Function         Fe/Yul   Fe/Yul+O   Sonatina        Sol      Sol+O   vs Sol+O
----------------------------------------------------------------------------------------------
bitwise_u256         and_              22411      22378      22529      22203      21920      +2.1%
bitwise_u256         or_               22433      22400      22555      22159      21920      +2.2%
bitwise_u256         xor_              22455      22422      22581      22115      21920      +2.3%
bitwise_u256         shl_              22453      22420      22586      22160      21860      +2.6%
bitwise_u256         shr_              22484      22451      22617      22128      21890      +2.6%
loops                counter           34063      34045      33209      80803      51550     -34.0%
loops                sum               38704      38686      35541     129342      71154     -45.6%
loops                xorLoop           41415      40626      38247      86157      57779     -29.7%
loops                counterUnchecked      34129      34111      33287      34957      32584      +4.7%
loops                sumUnchecked      38770      38752      35619      37760      34868     +11.1%
loops                xorLoopUnchecked      41478      40689      38318      40355      38857      +4.7%
math_u256            add               22387      22354      22505      22292      21860      +2.3%
math_u256            sub               22412      22379      22531      22336      21860      +2.4%
math_u256            mul               22433      22400      22559      22421      21860      +2.5%
math_u256            div               22458      22425      22585      22307      21860      +2.6%
math_u256            mod_              22477      22444      22604      22263      21860      +2.7%
storage_simple       store             44340      44317      44348      44106      43749      +1.3%
storage_simple       load              24259      24230      24402      23972      23630      +2.5%
storage_simple       storeAndLoad      44921      44900      45061      44517      43847      +2.4%

Interesting, loops seem to be significantly more gas efficient in Fe.
It's just the missing safemath

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant