"Dotnet watch run" is at least 18 times slower than what it could be.
See original GitHub issueHere are some results from testing on a simple console application - comparing it agains a custom dotnet watch run implementation that simply uses MsBuild:
| Method | Time to report a build error | Time to build and run |
| ---------------- | ---------------------------- | --------------------- |
| Custom watch run | 50 ms | 371 ms |
| Dotnet watch run | 974 ms | 2218 ms |
Both are running in release mode, with no additional steps or commands taken in order to imrpoove performance.
I want to provide a simple, stable and fast “hot-reloading” experience for my users.
Besides just wanting it for myself, I’m also working on a lib and I want to provide the users with the a simple and stable “hot reloading” experience with the following steps; Serialize -> Exit -> Build -> Run -> Deserialize.
I’m able to achive all of these steps. (Some if which run in parallel) with my “custom watch run” in less than 500 ms. I even have the option to maintain a host window, so it almost looks like the assembly was patched. Achiving “hot-reloading” this way is far more stable than patching DLL’s as you can change data structures and everything without things ever breaking. And I would love if dotnet watch run, was up to the task in terms of performance to provide that user experience, and be as good as it could be.
It could even help make software faster in general: Imagine if a fast version of “dotnet watch run” was next to the build button in visual studio. Then, if a users suddenly introduced code that takes the application a seccond longer to start up, it would be far more notisable if it went from 0s, to 1s, than if it went from going from 2s to 3s.
If dotnet could provide an “oh my god it recompiles and run fast” experience, it would go a long way to towards showing people what’s possible and encuraging other to go “I want that for my next application too!”. We’re spending our entire lives working in these enviroments, we should have a good and enjoyable time doing what we love - And when you’re working on hard problems, boy is it nice to be able to stay in the zone, and iterate quickly.
I honestly could go on forever. Should probably make a blog and write a blog post instead of jammering on in an issue 😊…
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (4 by maintainers)

Top Related StackOverflow Question
Thanks for contacting us. We plan a set of improvements in this area as part of https://github.com/dotnet/msbuild/issues/5876, which should address the concerns brought up in this issue.
cc @captainsafia