vscode-blockman icon indicating copy to clipboard operation
vscode-blockman copied to clipboard

this extensions causes whole VSCode to hangle on extremely large files. e.g package-lock.json

Open Shahid-Roofi-Khan opened this issue 3 years ago • 10 comments

There should be exclusion mechanism to exclude specific files like package-lock.json. (currently we can excluded all json files which is not ideal). Also there should be option to excuse files (project specific exclusions) because this extension basically can't handle very large size files so one should be able to make specific files excusion.

Otherwise it makes VSCode stuck and hang and one can't work at all.

Shahid-Roofi-Khan avatar Oct 16 '22 11:10 Shahid-Roofi-Khan

Hello @Shahid-Roofi-Khan, it's kinda strange that you have such problem. On my machine, I have package-lock.json file with 38,000 lines, and Blockman needs just 1-2-3 seconds to render blocks in it. For me, 1-2-3 seconds is fine because I don't visit such large files very often. So, in your case, how many seconds does it take to render the blocks inside package-lock.json file? And how many lines does it have?

leodevbro avatar Oct 16 '22 13:10 leodevbro

Hi @leodevbro thanks for responding for me, it makes VSCode completely useless on this file, i clone this repo and did npm i and it caused this issue: https://github.com/pgsandstrom/package-json-upgrade/blob/20c66b5783f5ed7cb5feb26b25886f994a3c4c37/package-lock.json#L1

only solution was to turn off all json and jsonc as exceptions. from where i was thinking if there was way to have specific files are exceptions because don't want to exempt all json files just for this package-lock.json file.

maybe its just a bug somewhere that happens in specific cases. try just this file and do npm i on this repo clone and try this file again, and it will make VSCode completely unusable and stuck with develop view showing this extension is hanging

Shahid-Roofi-Khan avatar Oct 17 '22 08:10 Shahid-Roofi-Khan

I tested on that package-lock.json file and Blockman renders blocks in about 1.5 seconds (On my machine).

Please provide:

  • What's the version of your VS Code? Mine is 1.72.2 (Regular VS Code, not VS Code Insiders)
  • How much RAM do you have? I have 32 GB.
  • What CPU do you have? I have AMD Ryzen 7 2700X 8-Core Processor

leodevbro avatar Oct 17 '22 10:10 leodevbro

i have CPU - Intel(R) Core(TM) i7-4910MQ CPU @ 2.90GHz - Cores: 4 - Logical processors: 8 and 32GB Ram. let me try to reproduce the issue and either send you video or connect with me remote while i reproduce this issue so you can see.

Shahid-Roofi-Khan avatar Oct 17 '22 13:10 Shahid-Roofi-Khan

I see my CPU (AMD Ryzen 7 2700X) seems much more powerful than i7-4910MQ.

https://www.cpubenchmark.net/compare/Intel-i7-4910MQ-vs-AMD-Ryzen-7-2700X

But I guess VS Code should not have such issues anyway.

Recording screen with the same machine is good, also remote watching is good, but these processes will further degrade performance during the test. So, maybe it's better to record screen with another device, maybe with your phone camera.

leodevbro avatar Oct 17 '22 13:10 leodevbro

here is the VID: https://1drv.ms/v/s!AolGnJ22BpKGn0rzKXftLORn3wXP?e=1NWw6T

as you make changes in large file, make any single character change, it hangs for next many seconds and keep making changes, it totally stuck and one can't do anything. only solution that worked for me was to add json file as exceptions and reload vscode.

Shahid-Roofi-Khan avatar Oct 17 '22 14:10 Shahid-Roofi-Khan

its latest VSCode todate (users installer). and not insiders edition.

Shahid-Roofi-Khan avatar Oct 17 '22 14:10 Shahid-Roofi-Khan

Thank you. I'll see it later. I'm not at home right now.

leodevbro avatar Oct 17 '22 14:10 leodevbro

Ok, I saw the video. Before I try to update Blockman with more customizations of which files should be included/excluded in terms of block-rendering, you can just use quick enable/disable command of Blockman. Press F1 and find "Blockman Toggle Enable/Disable", run it, so Blockman will be disabled super quickly, and run it again, and Blockman will be enabled super quickly. I don't recommend disabling Blockman from the extensions sidebar menu, because such disable/enable behavior will take more time.

So, before visiting large files, just disable blockman with that F1 command, and then enable it again. I hope this will make your experience better.

leodevbro avatar Oct 17 '22 17:10 leodevbro

thanks @leodevbro i added jsonc as exclusion type in extension settings for now which helped because i noticed changes also come in effect when you restart vscode. however excluding all json files is not ideal. imho exclusions at project level should be there so any problematic large file can be exempted for particular projects as its very necessary.

Shahid-Roofi-Khan avatar Oct 18 '22 08:10 Shahid-Roofi-Khan