microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.86k stars 29.51k forks source link

Large `.cpuprofile` cannot be loaded in developer tools #223565

Open debonte opened 4 months ago

debonte commented 4 months ago

Type: Bug

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

  1. Unzip the user-provided .cpuprofile files here
  2. Launch VS Code
  3. Developer: Toggle Developer Tools
  4. Switch to the "Performance" tab.
  5. Load pylance_2024.7.1_bg_1_id_0.cpuprofile

Result:

Initially the profile seems to be getting loaded:

image

After a minute or two, the window goes black and "never" (I waited 20-30 minutes) recovers. However, loading other, smaller files from the same ZIP succeeds. For example, pylance_2024.7.1_fg_id_0.cpuprofile.

image

VS Code version: Code - Insiders 1.92.0-insider (5fe066f8ebb29e7e7697f240e3aac4e6d733d993, 2024-07-24T20:30:23.504Z) OS version: Windows_NT x64 10.0.22631 Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz (12 x 3192)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|undefined| |Memory (System)|63.85GB (45.18GB free)| |Process Argv|--disable-extensions --crash-reporter-id ea9101de-1db0-4418-be8b-d4d0b3c9b928| |Screen Reader|no| |VM|0%|
Extensions disabled
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805cf:30301675 vsaa593:30376534 py29gd2263:31024238 c4g48928:30535728 2i9eh265:30646982 962ge761:30841072 pythongtdpath:30726887 welcomedialog:30812478 pythonnoceb:30776497 asynctok:30898717 dsvsc013:30777762 dsvsc014:30777825 dsvsc015:30821418 pythonregdiag2:30926734 pythonmypyd1:30859725 2e7ec940:31000449 pythontbext0:30879054 accentitlementst:30870582 dsvsc016:30879898 dsvsc017:30880771 dsvsc018:30880772 cppperfnew:30980852 pythonait:30973460 da93g388:31013173 a69g1124:31018687 dvdeprecation:31040973 dwnewjupyter:31046869 nb_pkg_only:31057982 nativerepl1:31093711 refactort:31084545 pythonrstrctxt:31093868 hdi1a554:31091669 flightc:31102344 ```
asparagusbeef commented 4 months ago

Hi! 👋 User in question here.

Giving extra info both to @debonte and any contributors here. After the profiling I realized I had some containers running with the repositories mounted as volumes. Note that when those containers are down the original issue persists. I don't know if it makes any difference to this specific issue, but just thought I'd let you know :)

roblourens commented 4 months ago

The download link is broken for that file. But, to open it in the "Performance" tab you need to add .json, or, you can open it as-is with .cpuprofile in VS Code and it should open in our visualizer 😄

The .cpuprofile suffix comes from the old "Javascript Profiler" tool in devtools which they got rid of. The current state is a bit confusing.

roblourens commented 4 months ago

If it is actually just too big to load in VS Code, we can look into that.

debonte commented 4 months ago

...we can look into that.

@roblourens, it's unclear to me why you closed this issue then? Is this work tracked somewhere else?

roblourens commented 4 months ago

If you have a problem with opening it in vscode, I can reopen the issue, but I'm not aware of any issues with that.

debonte commented 4 months ago

Oh, I misread one of your earlier comments and thought that you had managed to download the file and confirmed the behavior I was seeing.

I've reposted the ZIP file here. Could you please try again?

If Dropbox prompts you to login/signup, you can just close that dialog via the X icon -- you will still have access to the files.

roblourens commented 4 months ago

That's a pretty big profile 😓 I can't open it in vscode either

It seems to crash devtools, we can't do anything about that, but maybe vscode handle it

connor4312 commented 4 months ago

That is a hefty profile. Our model in VS Code isn't super memory efficient, at some point I will probably move the tooling into some native code/webassembly alongside our heap tools.

https://www.speedscope.app/ is another third party app that is reasonably speedy and you might have luck with.