Skip to content
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

Really Slow Performance in settings.json #27

Closed
macintacos opened this issue Jul 11, 2020 · 9 comments
Closed

Really Slow Performance in settings.json #27

macintacos opened this issue Jul 11, 2020 · 9 comments
Assignees
Labels
Milestone

Comments

@macintacos
Copy link

I recently experienced some severe lagginess when I opened settings.json, which I initially reported here: VSCodeVim/Vim/issues/5003. Feel free to check out the initial description and the screencast I made to see what was going on.

When I disabled this extension, all the lagginess I previously saw went away. I narrowed it down to this extension because the following message would load in the JS console every time that the UI became responsive again:

WARN UNRESPONSIVE extension host, 'fcrespo82.markdown-table-formatter' took 91% of 6207.224ms, saved PROFILE here: '/var/folders/h_/3f3z91t936q41d46hflhqq640000gn/T/exthost-739699.cpuprofile'

I copy/pasted the .cpuprofile file that it spit out, which is available below. I'm not exactly sure why this extension would be loading in a JSON document anyway, and I don't have any settings that force this extension to load, so it's a bit of a mystery. For the time being, I'm just going to completely disable this extension to get my performance back; hopefully you can figure out what's going on here.

File: /var/folders/h_/3f3z91t936q41d46hflhqq640000gn/T/exthost-739699.cpuprofile

@fcrespo82 fcrespo82 self-assigned this Jul 11, 2020
@fcrespo82 fcrespo82 added the bug label Jul 11, 2020
@fcrespo82
Copy link
Owner

Oh sh*t.... never saw that one... I'll look it

Can you send me your config for my extension?

This began with 2.0.5?

Can you try install 2.0.4 and see if the bug persist?

@macintacos
Copy link
Author

Here are the settings for the extension as I have it now (pretty sure they're all the default values?): https://p-37FYgJ.b1.n0.cdn.getcloudapp.com/items/xQuDJOkp/Settings%20%E2%80%94%20Testing%20VSCode%202020-07-10%20at%2023.55.29.png?v=984f74941cba185152b41bd28d1a2a9f

Will try the previous version and report back.

@macintacos
Copy link
Author

macintacos commented Jul 11, 2020

Okay so after some quick tests, it seems like this has been an issue since 2.0. I went all the way back to 1.4.3, and that's the first version (going backwards in time) that had no lag, and no message in the console. Every other version (2.0.0 -> 2.0.5) had the lag, and the same message in the console.

@fcrespo82
Copy link
Owner

fcrespo82 commented Jul 11, 2020

Yikes, I changed a lot from 1 to 2. But mostly important to this case (I think):

  • the packaging from multiple files to webpack;
  • a dependency: xregexp from 3.2.0 to 4.2.4;
  • the regex used to find the tables.

I never liked the fact that the extension is enabled on VSCode launch too, but to support enabling in any file type this is a must, but maybe it's time to change it... as this is called "markdown table formatter" it should be enabled only when markdown type files are opened.

I updated the regexp dependency to 4.3.0 because it said that it has better compatibility with web pack, and changed the activation to markdown only.. Can you test this one and check back please?

markdown-table-formatter-2.0.5.vsix.zip

@macintacos
Copy link
Author

@fcrespo82 I think that did the trick! I don't see any lag now with this version you provided.

@fcrespo82
Copy link
Owner

Great, let's be sure, as I changed the activation event, follow the steps below and report back please.

  1. Start vscode with no folder or files opened
  2. Open or create a markdown file with a table and test the functionality of the extension
  3. Follow your steps to reproduce the bug

@fcrespo82 fcrespo82 added this to the v2.1.0 milestone Jul 11, 2020
@macintacos
Copy link
Author

Okay so I might've jumped the gun since I didn't test the functionality of the extension before I said it worked before. While I can't reproduce the behavior exactly the way I saw it in the issue I brought up in the Vim extension (meaning, cold start, open settings.json, lag with navigation until it times out with the message I noted above), I can still reproduce it by doing pretty much what you specified:

  1. I started VSCode with no folder or files opened
  2. I created a brand new markdown file, created a table, and then used the "Move Column Left" command, which worked fine.
  3. I then opened the settings.json file, and saw the same lag

@fcrespo82
Copy link
Owner

Got it. I was afraid that would be the case.

My first thought was that the extension was slowing down the launch of the vscode. But apparently the bug is on another place. I'll investigate further, but I just had another idea that this may be reminiscent from the way the extension worked before using the formatter api, it trying to find table on all opened editors, not just on the language ones thus causing the slowness on the settings.json editor.

I will report back with any news soon.

Thanks for letting me know.

@fcrespo82
Copy link
Owner

I think I got it now... It really was a path in the code were it would check for tables in any opened file regardless of the language.

Check with this version please markdown-table-formatter-2.1.0-beta.vsix.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants