This repo allows developers to benchmark and compare how solx
performs against solc
in terms of output, performance, and compatibility. The repository contains a list of projects and a script to run the benchmarks against local projects that you might have.
- Foundry for running the tests
- Node.js (v14 or later) for building the dashboard
- Git for cloning and contributing
You can test any local Foundry project without adding it to this repository running the compare.sh
script with the -project
flag:
# Test a project in a different directory
./compare.sh -project ../my-other-project
Requirements for local projects:
- Must be a Foundry project (contains
foundry.toml
) - Should have tests that use the gas report feature
- The solc version will be read from your
foundry.toml
The results will appear in the dashboard under the project's directory name.
For detailed instructions on contributing new projects, managing dependencies, and running benchmarks, please see CONTRIBUTING.md.
-
Clone and set up:
git clone https://github.com/matter-labs/solx-solc-benchs cd solx-solc-benchs git submodule update --init --recursive
-
Add your project:
# Create from template cp -r ./template-foundry-project my-contracts/ # See CONTRIBUTING.md for detailed setup instructions
-
Run benchmarks:
./compare.sh my-contracts
-
View results:
- Open
dashboard/index.html
in your browser - Select your project from the dropdown
- Compare gas usage across different compiler configurations
- Open
-
View the dashboard:
- Open
dashboard/index.html
in your browser
- Open
-
Understanding the results:
- Select your project from the dropdown menu
- Compare gas costs between solx and solc versions
- View detailed method-by-method comparisons
- Check deployment costs and optimizations
Join the conversation on Telegram if you find bugs, have questions, or want to help build out better tools.