Skip to content

boa_benches: filtered script benchmark runs still eagerly initialize unrelated scripts #5169

Description

@iammdzaidalam

Problem

Filtered script benchmark runs still initialize unrelated script benches first.

While working on issue #5145 and adding a focused local script benchmark, I tried running only that target with:

cargo bench -p boa_benches -- json/stringify_deep

Even with the filter, benches/benches/scripts.rs initializes all discovered scripts. This includes v8-benches/deltablue, which overflows the stack during registration and aborts the run before the requested benchmark executes.

Repro

cargo bench -p boa_benches -- json/stringify_deep

This fails with a stack overflow in an unrelated v8-benches/* script.

Evidence

Adding temporary logging during registration shows all scripts being initialized:

REGISTERING BENCH: basic\call-loop
...
REGISTERING BENCH: v8-benches\deltablue
...

So the failure happens before the filtered benchmark is reached.

Root Cause

scripts.rs eagerly reads, parses, and evaluates all scripts during registration. Since Criterion filtering happens later, unrelated scripts can still fail and block targeted runs.

Expected Behavior

A filtered run should not be blocked by unrelated script benchmarks being initialized eagerly.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions