Skip to content

perf(macos): run fewer batches when most of the time is spent reading files - #1488

Merged
dsherret merged 1 commit into
mainfrom
perf/macos-read-bound-batches
Nov 30, 2026
Merged

dsherret merged 1 commit into
mainfrom
perf/macos-read-bound-batches

Conversation

@dsherret

Copy link
Copy Markdown
Member

On macOS, threads opening files contend with each other. Opening, reading and closing 5,000 files in a program that does nothing else took 21.7ms with 4 threads and 47.9ms with 12 on an M2 Pro.

When most of the time formatting files in batches is spent reading them, only 4 batches now keep taking files. There is no change when formatting takes most of the time, or on other platforms.

With plugins that do little work, on an M2 Pro:

Before After
check of 5,000 small files 62.8ms 47.9ms
with all of them in the incremental cache 64.7ms 44.4ms

I have only tried this on an M2 Pro, so the limit might not be the best one for other chips.

@dsherret
dsherret merged commit 8424126 into main Nov 30, 2026
6 checks passed
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.

1 participant