razor icon indicating copy to clipboard operation
razor copied to clipboard

Umbrella: Replace IDynamicDocumentInfoProviders

Open chsienki opened this issue 3 years ago • 39 comments

Today, razor tooling hosts the razor compiler in order to create design time documents. These are then injected into the Roslyn workspace via IDynamicDocumentInfoProvider.

Because the Roslyn workspace has the source generator, it also produces the same documents, and must be explicitly suppressed.

These means the compiler is used in two different ways: one for the tooling and one for the source generator. Ideally, we would just allow the source generator to run, and 'pull in' to the tooling the generated outputs. This would simplify the design of the compiler, allowing to potentially unlock performance enhancements.

Work items:

  • [x] #8642
  • [x] #8643
  • [x] #8644
  • [x] #8645
  • [x] #8646
  • [ ] #8647
  • [ ] #8648

IDE:

  • [x] #8845
  • [x] #8671

chsienki avatar Sep 28 '22 21:09 chsienki

Link to internal doc: https://microsoft-my.sharepoint.com/:w:/p/chsienki/EeNFcrfDIlJNtpCd2Lrr4IEBlXhgOXorRawSyNaAlv1PLw?e=qfHpeJ

chsienki avatar Sep 28 '22 22:09 chsienki

Added a couple of IDE issues too. Hope you don't mind, figured there was no point doing two tracking issues :)

davidwengier avatar Jun 21 '23 10:06 davidwengier

Kindly checking in on this issue. My build times on my primary Blazor server-side csproj are officially over 30 seconds now when simply adding a new line to a .razor file 😭

image

Mike-E-angelo avatar Aug 16 '23 10:08 Mike-E-angelo

Thank you for any update you can provide. Worth mentioning that it was only 17 seconds when reported in December.

So it would seem that I have incurred 15 seconds of additional build time over the course of 250 days with normal development, or .06 seconds per day.

Mike-E-angelo avatar Aug 22 '23 09:08 Mike-E-angelo

Thank you for any update you can provide on this issue. To summarize my current development experience:

  1. Building my Razor-based project takes roughly 32 seconds, up from 17 seconds when first reporting this over a year ago
  2. The simplest keypresses will incur 10-70% CPU utilization for nearly 90 seconds, up from 10-20% for 25 seconds when first reporting this over a year ago

While 10-20% is easier to tolerate, the state of my environment now is becoming increasingly difficult to endure, and even more so the more that I develop.

Additionally, it is concerning that I appear to be the only person reporting such obvious challenges with your software. I again ask that if there is something in particular about my solution that is causing such grief that can be mitigated, please let me know so that I can take steps to reduce the friction.

Thank you again for your continued diligence and any assistance/updates you can provide.

Mike-E-angelo avatar Aug 24 '23 10:08 Mike-E-angelo

Thank you for any update you can provide on this issue.

Mike-E-angelo avatar Aug 28 '23 09:08 Mike-E-angelo

Fourty-second build time, from introducing a single new line in the Program.cs file:

image

Thank you for any update you can provide on this issue.

Mike-E-angelo avatar Sep 01 '23 09:09 Mike-E-angelo

Thank you for any update you can provide on this issue. 🙏

This issue is now being tracked by my semi-weekly standups in Friction Points, where I discuss points of friction encountered in building a startup on Microsoft technology: https://youtu.be/vmqPNZHDmVI?si=rp8W6AvJqRDmMpFN&t=601

Mike-E-angelo avatar Sep 06 '23 08:09 Mike-E-angelo

This issue is being tracked by my semi-weekly standups in the Friction Points section, where I discuss points of friction encountered in building a startup based on Microsoft technology:

https://youtu.be/5vl6AIl-sNQ?si=MfXVwty5FO0j-WWd&t=719

Thank you for any update on this issue that you can provide. 🙏

Mike-E-angelo avatar Oct 04 '23 09:10 Mike-E-angelo

Sounds like this issue's status is at "we're aware of it and we'll talk about it at some point. maybe." image

https://github.com/dotnet/razor/issues/9369#issuecomment-1749650922

Mike-E-angelo avatar Oct 11 '23 11:10 Mike-E-angelo

This issue is being tracked by my semi-weekly standups in the Friction Points section, where I discuss points of friction encountered while building a startup based on Microsoft technology:

https://youtu.be/Ho4uhaow0ms?si=0g1pFFXn_9teKdbG&t=527

Mike-E-angelo avatar Nov 08 '23 09:11 Mike-E-angelo

Wow, so good news here... I tried this with the latest preview, and build times have been reduced by half. 😊 Maybe a side effect of #9214? 🤔

Whatever the reason, I am now seeing ~20-second build times whereas before I was seeing 40+ seconds:

image

Thank you for all your efforts out there! Happy Holidays. ❄

Mike-E-angelo avatar Nov 24 '23 12:11 Mike-E-angelo

FWIW/FYI I continue to track this issue in our semi-weekly standups: https://youtu.be/dLh5S1DcNFg?si=my0iX0HJYGm-dVzN&t=591

Thank you for any consideration toward improving the experience of a startup using your technology to succeed. 🙏

🦌 Happy Holidays ⛄❄

Mike-E-angelo avatar Dec 06 '23 08:12 Mike-E-angelo

Happy New Year out there 🙏

FWIW/FYI I am still tracking this issue and made mention of it today on X: https://twitter.com/Mike_E_angelo/status/1755588012962963748

Mike-E-angelo avatar Feb 08 '24 13:02 Mike-E-angelo

issue has been known for many months now and has not even started work yet. :(

The good news is that we're all much better at writing code than we are at issue tracking, project management and keeping GitHub issues up to date. I had a quick look and about 80% of our recent PRs are part of the broader work to move off IDynamicFileInfo. If you ever see terms like "cohosting" or project "fuse", those are all part of it too. We even have weekly meetings about it :)

davidwengier avatar Feb 08 '24 20:02 davidwengier

The good news is that we're all much better at writing code than we are at issue tracking, project management and keeping GitHub issues up to date

That really is good news, @davidwengier! Thank you very much for the update. That is awesome to hear that there's been work done towards this goal, along with the oh-so-amazing news that #8371 has been addressed too. 🙏🙏🙏

I've subscribed to the issues you have mentioned and will be following along. Thank you again for all your efforts out there. This has been a great week for me to have learned all this. 😌 👍

Mike-E-angelo avatar Feb 08 '24 21:02 Mike-E-angelo

FWIW I made some major project reductions in my solution and shaved off about 10 seconds of compile+launch time: https://twitter.com/Mike_E_angelo/status/1762043844743368953

😌

Unfortunately, however, this issue is creeping up with the build times again, going from 20 seconds the last I checked, to about 24-25 now. 😭

image

Mike-E-angelo avatar Feb 26 '24 09:02 Mike-E-angelo

Back again to 35-40 second build times with one line of code change in the project. 😞

image

It's a real drag, team. Please send halp. 😞😞😞

Mike-E-angelo avatar Apr 18 '24 17:04 Mike-E-angelo

If the build times are slow for regular builds, and not hot reload/enc related, then IDynamicDocumentInfo is not in play. I would recommend running dotnet build -bl to get a binary log of the build and see where the time is being spent. It's worth noting that the log file can contain information you might not want to be public (project file contents, file names and paths of every source file, etc.) so probably best to report through VS Feedback, that way the attachment is secure.

davidwengier avatar Apr 18 '24 22:04 davidwengier

Thank you for the update @davidwengier. If you can verify this ticket, it would be greatly appreciated. It's the reason why I have been pinging here. :)

https://developercommunity.visualstudio.com/t/Building-After-a-Few-Simple-Keypresses-T/10230756

As you can see, it's pointing to this issue.

Mike-E-angelo avatar Apr 19 '24 07:04 Mike-E-angelo

Updated with Version 17.10.0 Preview 4.0 build + binlog here:

https://developercommunity.visualstudio.com/t/1-Line-of-Code-Takes-Nearly-40-Seconds-t/10642151

Mike-E-angelo avatar Apr 19 '24 07:04 Mike-E-angelo

Hi @davidwengier any luck with the above, by chance? Thank you for efforts out there. 🙏

Mike-E-angelo avatar Apr 24 '24 17:04 Mike-E-angelo

I was just trying to direct you to the right place I'm afraid. The issue you logged is in the Razor compiler teams area and I'm sure they'll update it as appropriate. I doubt I'd be any help if I looked at it :)

davidwengier avatar Apr 24 '24 20:04 davidwengier

Whoa, so my original issue was closed and inadvertently redirected to the wrong issue here, do I have this understood correctly? 😭 I have been pinging this thread for over 8 months now, thinking this was the place to update as that is what the now-closed devcom ticket stated. 😞 All the while facing increasing build times as my codebase expands... 💔

Mike-E-angelo avatar Apr 24 '24 21:04 Mike-E-angelo

I was refering to the issue in your comment above mine, developercommunity.visualstudio.com/t/1-Line-of-Code-Takes-Nearly-40-Seconds-t/10642151. That issue is not closed.

davidwengier avatar Apr 25 '24 06:04 davidwengier

That issue is not closed

Correct, I understand. There are two issues. The one that I reported on December 14th, 2022 -- 498 days ago -- was closed and directed to this issue, which now appears to be in error. As this is now the biggest source of grief I am encountering with Visual Studio, I hope my concern is understandable.

Mike-E-angelo avatar Apr 25 '24 07:04 Mike-E-angelo

which now appears to be in error.

I'm not sure I'd agree with that, there are comments from people looking at memory dumps and traces and identifying issues, and it is entirely reasonable for IDynamicFile to be a source of perf concerns in the IDE, and there also being perf issues during build.

davidwengier avatar Apr 25 '24 08:04 davidwengier

and there also being perf issues during build

So, two issues then? 😉

Mike-E-angelo avatar Apr 25 '24 08:04 Mike-E-angelo

If only there were only two issues

davidwengier avatar Apr 25 '24 08:04 davidwengier

And now there are. ✨ My beef is that it took nearly 1.5 years to get to them. :)

Mike-E-angelo avatar Apr 25 '24 08:04 Mike-E-angelo