Skip to content

Comments

perf: use fsevents on macOS for file watching#7596

Merged
graphite-app[bot] merged 1 commit intomainfrom
12-19-perf_use_fsevents_on_macos_for_file_watching
Dec 22, 2025
Merged

perf: use fsevents on macOS for file watching#7596
graphite-app[bot] merged 1 commit intomainfrom
12-19-perf_use_fsevents_on_macos_for_file_watching

Conversation

@sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Dec 19, 2025

Now that I implemented some improvements (rolldown/notify#59, rolldown/notify#60), it doesn't error on large projects. kqueue doesn't have a way to watch recursively, so it's faster to use fsevent which supports recursive watches.

Copy link
Member Author

sapphi-red commented Dec 19, 2025


How to use the Graphite Merge Queue

Add the label graphite: merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@sapphi-red
Copy link
Member Author

Hmm, it seems mark_completion was called even though it was already completed happens...

@sapphi-red sapphi-red marked this pull request as draft December 19, 2025 12:16
@sapphi-red sapphi-red force-pushed the 12-19-perf_use_fsevents_on_macos_for_file_watching branch from d885312 to a4d03fc Compare December 19, 2025 13:40
@sapphi-red sapphi-red force-pushed the 12-19-fix_watch_property_respect_notify.pollinternal_and_notify.comparecontents_ branch from 338e84b to d140e49 Compare December 19, 2025 13:40
@graphite-app graphite-app bot changed the base branch from 12-19-fix_watch_property_respect_notify.pollinternal_and_notify.comparecontents_ to graphite-base/7596 December 19, 2025 18:23
@graphite-app graphite-app bot force-pushed the 12-19-perf_use_fsevents_on_macos_for_file_watching branch from a4d03fc to 5290eb8 Compare December 19, 2025 18:35
@graphite-app graphite-app bot force-pushed the graphite-base/7596 branch from d140e49 to f12b860 Compare December 19, 2025 18:35
@graphite-app graphite-app bot changed the base branch from graphite-base/7596 to main December 19, 2025 18:36
@graphite-app graphite-app bot force-pushed the 12-19-perf_use_fsevents_on_macos_for_file_watching branch from 5290eb8 to 9fc475c Compare December 19, 2025 18:36
@netlify
Copy link

netlify bot commented Dec 19, 2025

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 370d760
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6949853f8436020008a9f823

@sapphi-red sapphi-red force-pushed the 12-19-perf_use_fsevents_on_macos_for_file_watching branch from 9fc475c to 0daa03e Compare December 22, 2025 06:45
@sapphi-red sapphi-red marked this pull request as ready for review December 22, 2025 11:34
Copilot AI review requested due to automatic review settings December 22, 2025 11:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR switches from using kqueue to fsevents for file watching on macOS, improving performance for large projects through native recursive watch support. Additionally, it adds deduplication of file paths when processing watch events, since the same file can have multiple change types (create, update, delete) that need to be consolidated before rebuilding.

Key changes:

  • Removes explicit macos_kqueue feature flags from notify dependencies in Cargo.toml, allowing the default fsevents backend on macOS
  • Adds .unique() call to deduplicate file paths when multiple change events (different kinds) occur for the same file
  • Imports itertools::Itertools to support the .unique() method

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Cargo.toml Removes macos_kqueue feature overrides from rolldown-notify dependencies, enabling fsevents as the default backend on macOS
crates/rolldown/src/watch/watcher.rs Adds itertools import and .unique() call to deduplicate file paths when processing watch changes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 22, 2025

Benchmarks Rust

  • target: main(23da10d)
  • pr: 12-19-perf_use_fsevents_on_macos_for_file_watching(370d760)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.00     62.2±1.27ms        ? ?/sec    1.03     64.2±1.59ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.00     68.1±1.22ms        ? ?/sec    1.02     69.6±1.43ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00    105.8±2.82ms        ? ?/sec    1.01    107.1±2.04ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.00    117.1±1.48ms        ? ?/sec    1.02    119.5±1.75ms        ? ?/sec
bundle/bundle@threejs                                        1.00     38.9±0.60ms        ? ?/sec    1.03     40.1±1.92ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.00     42.4±0.56ms        ? ?/sec    1.02     43.0±0.58ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00    386.0±5.09ms        ? ?/sec    1.02    393.2±6.84ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    444.8±6.79ms        ? ?/sec    1.01    451.4±4.15ms        ? ?/sec
scan/scan@rome_ts                                            1.00     84.3±1.30ms        ? ?/sec    1.01     85.3±1.79ms        ? ?/sec
scan/scan@threejs                                            1.00     28.4±0.48ms        ? ?/sec    1.01     28.6±0.54ms        ? ?/sec
scan/scan@threejs10x                                         1.00    295.1±6.56ms        ? ?/sec    1.01    298.4±5.07ms        ? ?/sec

@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 22, 2025

Merge activity

Now that I implemented some improvements (rolldown/notify#59, rolldown/notify#60), it doesn't error on large projects. kqueue doesn't have a way to watch recursively, so it's faster to use fsevent which supports recursive watches.
@graphite-app graphite-app bot force-pushed the 12-19-perf_use_fsevents_on_macos_for_file_watching branch from 03eb9ab to 370d760 Compare December 22, 2025 17:51
@graphite-app graphite-app bot merged commit 370d760 into main Dec 22, 2025
34 checks passed
@graphite-app graphite-app bot deleted the 12-19-perf_use_fsevents_on_macos_for_file_watching branch December 22, 2025 18:02
This was referenced Dec 24, 2025
shulaoda added a commit that referenced this pull request Dec 24, 2025
## [1.0.0-beta.57] - 2025-12-24

✨ TypeScript Project References Support
- Rolldown now supports TypeScript project references when manually specifying a `tsconfig`
- See more details: https://rolldown.rs/options/tsconfig

💥 Rename `__export` to `__exportAll`
- Update `rolldown-plugin-dts` to the latest version for compatibility

### 💥 BREAKING CHANGES

- tsconfig: enable project references support in manual mode (#7545) by @shulaoda

### 🚀 Features

- add `CANNOT_CALL_NAMESPACE` warning (#7636) by @sapphi-red
- add import path for unresolved import diagnostics (#7625) by @sapphi-red
- optimize dynamic entry facade chunks by merging with common chunks when they are captured by common chunks (#7486) by @IWANABETHATGUY

### 🐛 Bug Fixes

- rename `__export` to `__exportAll` to be compatible with `cjs-module-lexer` (#7640) by @IWANABETHATGUY
- strip UTF-8 BOM when using text loader (#7635) by @sapphi-red
- rolldown_plugin_replace: avoid crashing with invalid delimiters (#7621) by @sapphi-red

### 🚜 Refactor

- export all filter functions (#7622) by @sxzz
- allow multiple help messages in diagnostics (#7624) by @sapphi-red

### 📚 Documentation

- add README.md to packages/rolldown (#7556) by @Copilot

### ⚡ Performance

- use fsevents on macOS for file watching (#7596) by @sapphi-red

### 🧪 Testing

- handle re-exports of external modules in CJS format (#7641) by @IWANABETHATGUY
- update integration to use vite's rolldown-canary branch (#7633) by @shulaoda

### ⚙️ Miscellaneous Tasks

- docs: fix Netlify ignore condition to detect docs changes across all PR commits (#7637) by @Copilot
- deps: update rollup submodule for tests to v4.54.0 (#7630) by @sapphi-red
- skip benchmarks for PRs with 'graphite: merge-when-ready' label (#7631) by @Boshen
- deps: update esbuild for tests to 0.27.2 (#7629) by @sapphi-red
- fix "update-test-dependencies" workflow (#7628) by @sapphi-red
- deps: update test262 submodule for tests (#7626) by @sapphi-red
- deps: update dependency oxlint to v1.35.0 (#7623) by @renovate[bot]

Co-authored-by: shulaoda <[email protected]>
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