Skip to content

Adding more fast tier benchmarks by splitting full projects by different root contracts - #15

Open
rodiazet wants to merge 1 commit into
mainfrom
fast-benchmarks
Open

Adding more fast tier benchmarks by splitting full projects by different root contracts #15
rodiazet wants to merge 1 commit into
mainfrom
fast-benchmarks

Conversation

@rodiazet

Copy link
Copy Markdown
Contributor

This PR introduce a mechanism which split chosen existing projects into smaller parts covering different parts of the compiler pipeline.
They are generated by a dedicated subset.py script into a separated subfolder in benchmark_data.

Depends on #14

@rodiazet
rodiazet requested a review from r0qs July 23, 2026 09:48
@rodiazet rodiazet changed the title Split subset benchmarks into benchmark_data/subsets/ Adding more fast tier benchmarks by splitting full projects by different root contracts Jul 23, 2026
@rodiazet
rodiazet requested review from Copilot and msooseth and removed request for Copilot July 23, 2026 10:05
@rodiazet
rodiazet requested a review from blishko July 24, 2026 06:52

@blishko blishko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, the idea is that if you select the parent directory, it will also run benchmarks in subdirectories? Is that a good idea?

@blishko

blishko commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Also, can someone explain to me how are tags decided? Why some benchmarks have tags like abi and yul-optimizer, but others don’t?

@rodiazet

Copy link
Copy Markdown
Contributor Author

So, the idea is that if you select the parent directory, it will also run benchmarks in subdirectories? Is that a good idea?

Not exactly. It runs compilation benchmarks on the import closures. We want to have more benchmarks in the fast tier but most of the project are too big to get into this tier. So the script divides the project to submodules together with the imports they use and then based on the compilation time they need you can assign to a proper tier. I assumed for now that the contract in the fast tier compiles in <5sec.

@rodiazet

Copy link
Copy Markdown
Contributor Author

Also, can someone explain to me how are tags decided? Why some benchmarks have tags like abi and yul-optimizer, but others don’t?

subset - built by scripts/subset.py from another project's input by pulling just one root contract's import closure
analysis - outputSelection is empty (no codegen requested), it only exercises parsing + semantic analysis, not code generation.
codegen - request bytecode output (as opposed to analysis).
assembly - root contract is near entirely inline assembly
yul-optimizer - puts significant load on the Yul optimizer specifically (heavy assembly plus optimization passes)
transient-storage - The subset exercises transient storage opcodes (tstore/tload)

@rodiazet
rodiazet requested a review from blishko July 30, 2026 07:21
@rodiazet
rodiazet force-pushed the add-benchmarks branch 2 times, most recently from 91f2153 to a48ace0 Compare August 5, 2026 14:55
@rodiazet
rodiazet deleted the branch main August 5, 2026 14:56
@rodiazet rodiazet closed this Aug 5, 2026
@rodiazet

rodiazet commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Closed by mistake

@rodiazet rodiazet reopened this Aug 5, 2026
@rodiazet
rodiazet changed the base branch from add-benchmarks to main August 5, 2026 15:01

@clonker clonker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally a good thing to have! But I think the implicit globbing is a bit weird. I'd rather have it explicit. What do you think?

Comment thread src/solc_bench/config.py Outdated
benchmark_dir = Path(benchmark_dir)
benchmarks = _load_benchmarks_file(benchmark_dir / "benchmarks.toml")

for sub_toml in sorted(benchmark_dir.glob("*/benchmarks.toml")):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This merges whatever it finds. That's also the exact same namespace gas.py:ensure_project clones Forge projects into. I'd prefer an explicit include = ["subsets"] in the top-level benchmarks.toml I think.

Comment thread scripts/subset.py Outdated
import re
import sys

IMPORT_RE = re.compile(r'import\s+(?:{[^}]*}\s+from\s+)?["\']([^"\']+)["\']')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't match import * as XY from "path";, does it?

Comment thread scripts/subset.py Outdated
if cur in seen:
continue
if cur not in sources:
print(f"warning: {cur} not in sources, skipping", file=sys.stderr)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should exit I think.

Comment thread src/solc_bench/config.py Outdated
root_path = benchmark_dir / f"{name}.json"
if root_path.is_file():
return root_path
for sub_toml in benchmark_dir.glob("*/benchmarks.toml"):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make this sorted?

Comment thread src/solc_bench/benchmark.py Outdated
config.get("source"),
config.get("version"),
benchmark_dir,
input_file.parent,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is just the benchmark_dir, isn't it?

@rodiazet
rodiazet requested a review from clonker August 6, 2026 15:20
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.

3 participants