rafamel/subtle-brackets

Extension causes high cpu load

gxbsst opened this issue · 3 comments

- Issue Type: Performance

  • Extension Name: subtle-brackets
  • Extension Version: 3.0.0
  • OS Version: Darwin x64 18.2.0
  • VSCode version: 1.32.2

⚠️ Make sure to attach this file from your home-directory: /Users/weston/rafamel.subtle-brackets-unresponsive.cpuprofile.txt ⚠️

Find more details here: https://github.com/Microsoft/vscode/wiki/Explain:-extension-causes-high-cpu-load
rafamel.subtle-brackets-unresponsive.cpuprofile.txt

Hi @gxbsst, I'm sorry I haven't had the time to properly look at the issue and its root causes. The subtle brackets algo itself is reasonably efficient and there is no reason I can think of at the top of my head for it to be causing high cpu load, so there is a big chance this is caused by the Prism parsing engine. There's also the possibility some VSCode version bump changed some internals that are having an effect over the extension.

In any case, I am an user of the extension and have also been noticing a higher than usual load when using VSCode. It's anecdotal, because I haven't had the time to measure it properly, but I've disabled the subtleBrackets.parse option @ settings and it seems to have helped. The downside to this is the extension won't be able to tell whether something is a string or a comment, and so if a bracket pair opens there, it will treat is as part of the code. As we don't have any other universal parser as of right now, it could be a reasonable tradeoff to have as a extension default if that seems to be the issue.

All in all, could you try disabling subtleBrackets.parse and get back to me on whether you're still seeing a high load coming from the extension?

Also having this issue. Here's my file:

rafamel.subtle-brackets-unresponsive.cpuprofile.txt

I might release a new version with an ad-hoc parser in the future to address this. Unfortunately, I'm pressed for time at the moment, but it could happen before end of year. Happy to take a look at other parsers or take in PRs addressing this.

In the meantime, disable parsing by setting subtleBrackets.parse to false