Skip to content

Optimized file watcher hot path, removed allocations, fixed thread-sa…#104

Open
DezLife wants to merge 5 commits into
mainfrom
perf/file_watcher_optims
Open

Optimized file watcher hot path, removed allocations, fixed thread-sa…#104
DezLife wants to merge 5 commits into
mainfrom
perf/file_watcher_optims

Conversation

@DezLife
Copy link
Copy Markdown
Member

@DezLife DezLife commented May 13, 2026

File watcher subsystem refactor.

  • Race condition fixed: FS events queued and drained on main thread
  • Removed per-event allocations (LINQ, GetExtension switches, Activator)
  • WatchFolder is now config-only, single OnEvent callback
  • Renamed events dispatched
  • Misc fixes: OnRenamed key collision, watcher dispose leak, &&/|| typo

Tested: clean build, server boot, hot-reload works.

Comment thread src/Carbon.Components/Carbon.Common/src/Base/BaseProcessor.cs Fixed
Comment thread src/Carbon.Components/Carbon.Common/src/Base/BaseProcessor.cs Fixed
Comment thread src/Carbon.Components/Carbon.Common/src/Base/BaseProcessor.cs Fixed
@DezLife DezLife force-pushed the perf/file_watcher_optims branch from 245c4bd to b1231e6 Compare May 13, 2026 18:29
WatchFolder is now a pure config object — FileSystemWatcher lifecycle
moved into FileWatcherManager. Events unified through Action<WatchFileEvent>.
Renamed support added. BaseProcessor uses the same struct internally.
Comment thread src/Carbon.Components/Carbon.Common/src/Base/BaseProcessor.cs Fixed
Comment thread src/Carbon.Components/Carbon.Bootstrap/src/Components/FileWatcherManager.cs Dismissed
Comment thread src/Carbon.Components/Carbon.Common/src/Base/BaseProcessor.cs Fixed
Comment thread src/Carbon.Components/Carbon.Bootstrap/src/Components/Addons/ExtensionManager.cs Dismissed
Comment thread src/Carbon.Components/Carbon.Bootstrap/src/Components/Addons/ModuleManager.cs Dismissed
Comment thread src/Carbon.Components/Carbon.Bootstrap/src/Components/FileWatcherManager.cs Dismissed
Comment thread src/Carbon.Components/Carbon.Bootstrap/src/Components/FileWatcherManager.cs Dismissed
Comment thread src/Carbon.Components/Carbon.Common/src/Base/BaseProcessor.cs Fixed
DezLife and others added 2 commits May 13, 2026 23:23
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Comment thread src/Carbon.Components/Carbon.Common/src/Base/BaseProcessor.cs Dismissed
Comment thread src/Carbon.Components/Carbon.Common/src/Base/BaseProcessor.cs Dismissed
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