-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] High energy consumption on macOS #1746
Comments
It doesn't look like this is specific to MAUI since the customer mentioned ASP.NET Core Blazor. |
I have been experiencing this same issue when working with our Blazor web app on a MacBook Air M2. I started disabling extensions to try and find if one of them was the cause, and after I disabled C# the battery drain stopped. If it helps, I noticed output in the Problems pane constantly changing, indefinitely, almost as if it kept recompiling/analyzing the codebase. |
it definitely stopped consuming battery, I made a video but its looks like too large to be uploaded. @AllenD-MSFT this confirms it. |
@AllenD-MSFT @GregCilio here's the video, had to export it to 720p: C.Extension.high.energy.consumption720p.mov |
#1740 seems like this issue is related |
Edit and removed the .net maui part. |
Any updates on this ? |
I think the high energy consumption is caused by high CPU usage that is triggered by certain Blazor apps (not all) when C# DevKit is used. I have logged a similar issue #1806 |
yeah, I just used my main problem with it as a title at the time 😅. I believe the Blazor Apps this happens with tend to be the ones that are upgraded from older version of .NET this one im working on was originally built with .NET 5. |
This could be right, we recently upgraded our Blazor app from .NET 6 to .NET 8. |
Just to be clear, is this with the same version of the extension or did that also change? |
In my case the version I had when I posted this was 2.61.28 i've updated to 2.63.32 and still happens. |
That would indicate that code lense isn't working for razor files. I'm not sure if that specifically would have anything to do with high CPU consumption. It's possible but unlikely |
After a few reports like microsoft/vscode-dotnettools#1746 and microsoft/vscode-dotnettools#1740 diagnostics are causing users some headaches (and a few other issues I can't find) In VS we avoid this by using pull diagnostics. In VS Code we publish all diagnostics in the workspace. This PR simply makes it so VS Code now also uses pull diagnostics! There are a few caveats to this: 1. HTML diagnostics aren't supported. As it turns out, they weren't before anyways. VS Code has no way to ask for them in a generic manner. This isn't a regression but I'll call it out 2. Workspace diagnostics aren't supported (yet). Users may notice that diagnostics aren't reported until a razor file is open. The generated document will still get C# diagnostics through Roslyn workspace diagnostics (I think? Assuming dynamic files aren't filtered...). This matches our VS behavior 3. This duplicates some code adn tests. VS had it's own pull diagnostics prior to it being in the spec. I think we can merge the two but I'm leaving that out of the scope of this PR. This will require a PR in VS Code to adapt to the new data sent over our custom LSP method.
This will be coming in next week's prerelease when dotnet/razor#11602 makes it into the extension |
Describe the Issue
result from command code -status:
`Version: Code 1.96.4 (cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba, 2025-01-16T00:16:19.038Z)
OS Version: Darwin arm64 24.2.0
CPUs: Apple M1 Pro (8 x 2400)
Memory (System): 16.00GB (0.09GB free)
Load (avg): 7, 6, 4
VM: 0%
Screen Reader: no
Process Argv: --crash-reporter-id a61d8841-dc3f-4d9d-917e-d56ff42ebb1b
and this is the energy consumption from activity monitor:
Steps To Reproduce
open any project with asp.net core blazor on vs code (with c# and c# dev kit extensions installed)
Expected Behavior
No response
Environment Information
-OS: MacOS sequoia 15.2
-VS Code Version: 1.96.4 (Universal)
The text was updated successfully, but these errors were encountered: