Skip to content

feat: use serial mode to reduce execution time - #15

Merged
ematipico merged 1 commit into
biomejs:mainfrom
adamchainz:use_serial_mode
Dec 6, 2024
Merged

ematipico merged 1 commit into
biomejs:mainfrom
adamchainz:use_serial_mode

Conversation

@adamchainz

Copy link
Copy Markdown
Contributor

By default, pre-commit spawns parallel processes for checking files. Biome is already fast, so parallelization adds little benefit but makes output harder to read by splitting summary statistics across processes.

This change ensures Biome runs serially to provide cleaner, combined output. Local benchmarks show Biome still completes quickly (~0.2s) without parallelization.

Before:

$ pre-commit run biome-check -a -v
biome check..............................................................Passed
- hook id: biome-check
- duration: 0.21s

Checked 25 files in 46ms. No fixes applied.
Checked 25 files in 63ms. No fixes applied.
Checked 25 files in 35ms. No fixes applied.
Checked 25 files in 65ms. No fixes applied.
Checked 25 files in 87ms. No fixes applied.
Checked 25 files in 89ms. No fixes applied.
Checked 25 files in 29ms. No fixes applied.
Checked 25 files in 69ms. No fixes applied.
Checked 25 files in 50ms. No fixes applied.
Checked 25 files in 59ms. No fixes applied.

After:

$ pre-commit run biome-check -a -v
biome check..............................................................Passed
- hook id: biome-check
- duration: 0.13s

Checked 250 files in 68ms. No fixes applied.

Note that the runtime actually drops, at least on my machine for this project. The cost of spawning lots of separate processes seems to be higher than actually linting the files.

@ematipico

Copy link
Copy Markdown
Member

Wow, biome got even faster 🤯

@ematipico ematipico changed the title Use serial mode feat: use serial mode to reduce execution time Dec 6, 2024
@ematipico
ematipico requested review from nhedger and removed request for nhedger December 6, 2024 11:27
@ematipico
ematipico merged commit f71ccf5 into biomejs:main Dec 6, 2024
@adamchainz
adamchainz deleted the use_serial_mode branch December 6, 2024 15:41
@adamchainz

Copy link
Copy Markdown
Contributor Author

Or, at least, pre-commit isn't making it slower :)

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.

2 participants