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

Extension causes high cpu load #23

Open
arkceajin opened this issue Dec 23, 2019 · 7 comments
Open

Extension causes high cpu load #23

arkceajin opened this issue Dec 23, 2019 · 7 comments
Labels
bug Something isn't working

Comments

@arkceajin
Copy link

  • Issue Type: Performance
  • Extension Name: vscode-xml-complete
  • Extension Version: 0.2.5
  • OS Version: Windows_NT x64 10.0.18362
  • VSCode version: 1.41.1

⚠️ Make sure to attach this file from your home-directory:
⚠️C:\Users\siu\rogalmic.vscode-xml-complete-unresponsive.cpuprofile.txt
rogalmic.vscode-xml-complete-unresponsive.cpuprofile.txt

Find more details here: https://github.com/microsoft/vscode/wiki/Explain-extension-causes-high-cpu-load

@rogalmic
Copy link
Owner

Thank you for this report.

Any chance to get the actual xml/xsd files used for this run to confirm my suspicions?

@rogalmic rogalmic added the bug Something isn't working label Dec 25, 2019
@arkceajin
Copy link
Author

arkceajin commented Dec 25, 2019

Hi, here it is https://raw.githubusercontent.com/autosaros/Standards/master/Adaptive%20Platform/19.03/MethodologyAndManifests/AUTOSAR_MMOD_XMLSchema/AUTOSAR_00047.xsd
I think you already tried this, the error may not 100% reproducible, seems a performance issue.

BTW, for me, the big issue is the completion didn't same as https://marketplace.visualstudio.com/items?itemName=redhat.vscode-xml. I am not sure does it caused by the big XSD file.
And suggest the priority of vscode config high than XML specification.
if the indicated xsdUri and xmlns can be correctly parsed and found, the xsi:schemaLocation won't be parsed.

"xmlComplete.schemaMapping":
[
    {
        "xmlns": "http://autosar.org/schema/r4.0",
        "xsdUri": "file:///C:/Users/s-jiu/Desktop/AP-R19-03/MethodologyAndManifests/AUTOSAR_MMOD_XMLSchema/AUTOSAR_00047.xsd",
        "strict": true // shows errors instead of tips
    }
]
<AUTOSAR 
xmlns="http://autosar.org/schema/r4.0" 
xsi:schemaLocation="http://autosar.org/schema/r4.0" <-- this path will be ignore
>

@rogalmic
Copy link
Owner

Is the opened/parsed xml* file big, containing many similar nodes? Or does it reproduce for simple xml root without any nodes?

*Not talking about schema xsd file here

@arkceajin
Copy link
Author

arkceajin commented Dec 26, 2019

Hi, This is the xml
AUTOSAR_SWS_ExecutionManagement.zip

containing many similar nodes?

I don't think it contains too much similar nodes.

Or does it reproduce for simple xml root without any nodes?

It hard to reproduce, but the xml I used almost same size as the uploaded one. Simple xml seems won't occur, but still give very long loading time for the auto-complete.

@rogalmic
Copy link
Owner

I think i was able to reproduce this terrible performance.

Fix applied:
2005888#diff-dd023fbd0c2c0b45603ea23421f17eed

To test, manually uninstall extension, RESTART vscode, install following vsix:
https://github.com/rogalmic/vscode-xml-complete/releases/tag/untagged-d5e59da4586c9b367deb

Please let me know if you see any issues still...

@arkceajin
Copy link
Author

arkceajin commented Jan 7, 2020

@rogalmic Hi, I tried the vsix, looks like it works, the autocomplete windows popup faster. Thanks.
But when I fixed incorrect tag, the highlight disappear very slow.
And the autocomplete still don't gives expected result.
Fox example, tag suppose only allow and under it, the autocomplete gives ton of result.
image
Shall I start an new issue for this problem?

@rogalmic
Copy link
Owner

rogalmic commented Jan 7, 2020

The autocompletion for tags will give full list of tags - it is current limitation as full schema parsing is not provided yet. No need for new issue (#18).

As for the parsing performance after edit, I will check that withing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants