question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Dotnet watch run" is at least 18 times slower than what it could be.

See original GitHub issue

Here 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
mkArtakMSFTcommented, Feb 9, 2021

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.

0reactions
sfoslundcommented, Feb 8, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet core 2 long build time because of long restore time
I prefer to use dotnet watch run but that seems even slower. Running dotnet watch to view the parameters is taking 12 seconds....
Read more >
.NET 6 compilation speed on macOS Monterey - am I ...
I have built a blank console app with dotnet new console , but I am kind of shocked by how slow the compile...
Read more >
dotnet watch command - .NET CLI
The dotnet watch command is a file watcher that runs a dotnet command when changes in source code are detected.
Read more >
Unit tests running slow - does not seem to use all cores
I have an Intel i7-4790K 4.00GHz quad-core cpu. In the past I noticed that the little "play" icon would be next to typically...
Read more >
What's New in ASP.NET Core in .NET 6
ASP.NET Core is a modern Web framework for .NET and includes everything you need to build beautiful Web UIs and powerful back-end services....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found