Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix performance on MacOS #80

Merged
merged 2 commits into from
Nov 22, 2024

Conversation

rbtcollins
Copy link
Collaborator

Most MacOS filesystems will be APFS these days, which appears to have a
global lock around readdir that leads to thrashing when performing
readdir concurrently from different threads.

https://gregoryszorc.com/blog/2018/10/29/global-kernel-locks-in-apfs/

This patch:

  • makes the parallel strategy selectable at runtime
  • selects serial when running on MacOS - this will disable parallelism when it is not needed (e.g. when using NFS on MacOS), and fail to disable it when it should be (e.g. when using NFS to access files on a MacOS server)
  • exposes this via the cli to make testing it easier.

- expose via the CLI
- add a new Builder and Remover struct to hold any other future things
  we might make configurable.
Most MacOS filesystems will be APFS these days, which appears to have a
global lock around readdir that leads to thrashing when performing
readdir concurrently from different threads.

https://gregoryszorc.com/blog/2018/10/29/global-kernel-locks-in-apfs/
@rbtcollins rbtcollins force-pushed the rbt/darwin-performance branch from 1d21136 to 92a0f1a Compare November 22, 2024 11:44
@rbtcollins rbtcollins merged commit c18afff into XAMPPRocky:master Nov 22, 2024
18 checks passed
@rbtcollins rbtcollins deleted the rbt/darwin-performance branch November 22, 2024 11:50
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