Repository navigation
Description
Environment information
biome rage (2.5.13, standalone reproduction directory)
CLI:
Version: 2.5.13
Color support: false
Platform:
CPU Architecture: aarch64
OS: macos
Environment:
BIOME_DISTRIBUTION: unset
BIOME_LOG_FILE: unset
BIOME_LOG_PATH: unset
BIOME_LOG_PREFIX_NAME: unset
BIOME_LOG_LEVEL: unset
BIOME_LOG_KIND: unset
BIOME_CONFIG_PATH: unset
BIOME_THREADS: unset
BIOME_WATCHER_KIND: unset
BIOME_WATCHER_POLLING_INTERVAL: unset
BIOME_BINARY: unset
RUST_BACKTRACE: unset
NO_COLOR: 1
TERM:
JS_RUNTIME_VERSION: unset
JS_RUNTIME_NAME: unset
NODE_PACKAGE_MANAGER: unset
Biome Configuration:
Status: Loaded successfully.
Path: biome.json
Formatter enabled: true
Linter enabled: true
Assist enabled: true
VCS enabled: false
HTML full support enabled: unset
Workspace:
Open Documents: 0
Compared official macOS ARM64 CLI binaries for 2.5.10, 2.5.11, 2.5.12, and 2.5.13. No plugins or imports are needed for the reproduction.
What happened?
After upgrading Biome from 2.5.10 to 2.5.13, checking generated TypeScript mock files became dramatically slower. The regression is already present in 2.5.11 and also affects format alone.
I reduced the trigger to an arrow function returning a large parenthesized object expression: () => ({ ... }). Changing only this structure to () => { return { ... }; } avoids the slowdown.
Standalone reproduction
- In an empty directory, run this Python script to create the configuration and test files. No project dependencies, imports, or plugins are required.
foois just a syntactic placeholder; the files are formatted, not executed.
from pathlib import Path
import json
Path("biome.json").write_text(json.dumps({
"formatter": {
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100
}
}))
for n in (2000, 4000):
props = "\n".join(
f" field{i}: foo({{ min: 1, max: 10 }}),"
for i in range(n)
)
Path(f"paren-{n}.ts").write_text(
"const f = () => ({\n" + props + "\n});\n"
)
Path(f"block-{n}.ts").write_text(
"const f = () => {\n return {\n" + props + "\n };\n};\n"
)- Preformat the files with 2.5.10 so formatting differences do not distort the comparison:
pnpm dlx @biomejs/biome@2.5.10 format --write paren-2000.ts paren-4000.ts block-2000.ts block-4000.ts- Compare the versions on the same files:
pnpm dlx @biomejs/biome@2.5.10 format paren-4000.ts
pnpm dlx @biomejs/biome@2.5.13 format paren-4000.ts
pnpm dlx @biomejs/biome@2.5.13 format block-4000.tsThe same regression can be observed with 2.5.11 and 2.5.12. For timing, invoke the installed native CLI directly to exclude package downloads and package-manager startup.
Measured results
Wall-clock seconds, invoking the official native binaries directly with the configuration above. These are individual local measurements, not statistical benchmarks. All completed runs exited successfully. >5 s means the process was terminated after five seconds, not that it completed in five seconds.
| Version | Parenthesized, 2,000 properties | Parenthesized, 4,000 properties | Block return, 4,000 properties |
|---|---|---|---|
| 2.5.10 | 0.021 s | 0.034 s | 0.035 s |
| 2.5.11 | 1.476 s | >5 s | 0.034 s |
| 2.5.12 | 1.483 s | >5 s | 0.034 s |
| 2.5.13 | 1.458 s | >5 s | 0.030 s |
In the original approximately 2.4 MB generated file, changing object-return arrow functions to block bodies also restored formatting to roughly 0.1–0.2 seconds on the affected versions. The synthetic reproduction above avoids sharing project-specific source.
Suspected cause (source inspection, not confirmed with a patched build)
#11467 (fix(parse/js): disambiguate parenthesized object expressions), which fixes #11464, appears relevant to the 2.5.10 → 2.5.11 boundary.
The new lookahead for parenthesized object/array expressions calls token_after_parenthesized_group, which advances an offset and repeatedly calls p.nth(offset) until the matching closing parenthesis.
In BufferedLexer::nth_non_trivia, extending lookahead uses self.lookahead_iter().skip(current_length). Repeatedly extending the cache appears to traverse the already-buffered prefix again, potentially making a long scan quadratic.
Relevant sources at the 2.5.11 release commit:
The version boundary and syntax-dependent slowdown are measured observations; the explanation above is a hypothesis from source inspection. This report and investigation were prepared with AI assistance.
Expected result
Formatting and checking large parenthesized object expressions should complete with performance comparable to 2.5.10. The equivalent () => ({ ... }) and () => { return { ... }; } forms should not exhibit this large performance difference.
Ideally, scanning to the matching parenthesis should avoid repeatedly traversing the same buffered token prefix, while preserving the parser correctness fix for #11464.
Code of Conduct
- I agree to follow Biome's Code of Conduct
Activity
biome-cookie commentedon Sep 12, 2026
Hello @yamaaaaaa31, please provide a minimal reproduction. You can use one of the following options:
npm create @biomejs/biome-reproductionIssues marked with
S-Needs reprowill be closed if they have no activity within 3 days.yamaaaaaa31 commentedon Sep 12, 2026
I've created a standalone reproduction using the official reproduction CLI:
https://github.com/yamaaaaaa31/biome-11747-repro
To run it:
git clone https://github.com/yamaaaaaa31/biome-11747-repro.git cd biome-11747-repro npm ci npm run reproThe script compares Biome 2.5.10 and 2.5.13 using their native binaries directly, with a 5-second timeout per run. All fixtures contain synthetic data; no application dependencies, imports, or plugins are needed.
On macOS ARM64, the 4,000-property parenthesized object takes approximately 0.03–0.04 seconds with 2.5.10, while 2.5.13 exceeds the 5-second timeout. The equivalent block-return control completes in approximately 0.03 seconds with 2.5.13. All completed runs exit successfully.
The repository includes the fixtures, generator, benchmark script, and measured results. These are individual local measurements, not statistical benchmarks. Prepared with AI assistance.
ematipico commentedon Sep 12, 2026
I was hoping you'd give me a project or something I could work with...
yamaaaaaa31 commentedon Sep 12, 2026
@ematipico
Thanks for taking a look. This is my first issue in this repository, so I may have misunderstood what you expected from the reproduction. Could you clarify what’s missing from the project I linked or what you’d like me to change? I’d be happy to update it.
ematipico commentedon Sep 12, 2026
You created synthetic data, not a real world example. And that part of the code you mentioned hasn't been changed AFAIK.
You're more than welcome to look at why it's slower, but I wouldn't put much priority this for now, there are other real bugs with real uses cases from real users :)
yamaaaaaa31 commentedon Sep 12, 2026
@ematipico
Thanks for clarifying. I should have explained the real-world context more clearly. We encountered this slowdown in our application when upgrading Biome from 2.5.10 to 2.5.13.
We use Orval to generate TypeScript API clients, Zod schemas, and MSW mocks from OpenAPI, with Biome formatting the generated output. The slowdown was narrowed down to a generated MSW mock file. I created the synthetic example to isolate the behavior without sharing application-specific details.
I’ve now added an anonymized copy of an actual generated MSW file to the reproduction repository, preserving its expression structure. Both the original and anonymized versions complete formatting in approximately 0.13 seconds with 2.5.10, but exceed a five-second timeout with 2.5.13 on macOS ARM64. You can reproduce this by running npm ci followed by npm run format in the updated repository.
The suspected cause remains an unverified hypothesis; I haven’t confirmed it with a patched build. Thank you for taking the time to look into this.
ematipico commentedon Sep 12, 2026
Lovely, thank you!
ematipico commentedon Sep 12, 2026
I could reproduce. thank you.
ematipico commentedon Sep 12, 2026
New preview release available for
@biomejs/biome.Branch:
fix/parse-regressoin(#11749)Install it using the following command:
yamaaaaaa31 commentedon Sep 12, 2026
@ematipico
Thanks for the fix! I tested the preview build against our actual application using our existing Biome configuration and plugins.
Both
biome format .andbiome check .passed across all 2,296 files, taking approximately 0.56 seconds and 0.73 seconds respectively—comparable to 2.5.10. With 2.5.13, both commands exceeded a 20-second timeout.This confirms that the reported slowdown is resolved in our project. Thank you for looking into this so quickly!
Update dependency @biomejs/biome to v2.5.14 (#24)
Update dependency @biomejs/biome to v2.5.14 (#45)