Comments (21)
Have you some trouble with large file?
from lemminx.
not necessarily yet, but we need to think about setting up performance tests, once all the major features are complete
from lemminx.
not necessarily yet, but we need to think about setting up performance tests, once all the major features are complete
If there is performance problem with big file, I think vscode html language service will have the same problem since XMLDocument is rebuild each time you type some content inside editor (TextDocumentSyncKind.Full).
I think to improve performance, TextDocumentSyncKind.Incremental should be used, but I think it's an hard thing to do.
from lemminx.
@angelozerr whatever performance the vscode html has, since the xml parser starts to deviate from it (in many ways), we might see a different behaviour, better or worse.
I'm not saying we need to improve the performance now, just that we need to keep track of it eventually. What matters now is to provide correct results. Worry about performance later.
from lemminx.
What matters now is to provide correct results. Worry about performance later.
Totally agree with you. Thanks for creating this issue.
from lemminx.
After testing largeFile.txt
I deleted the 2nd last tag </a>
in Intellij it took ~2.8 seconds and in lsp4xml ~4.7 seconds till a missing end tag response was received.
from lemminx.
15000L is not what I call large :-) I was thinking about 10's of MB (even that's not large, depending on the context)
Anyways, I think we're getting murdered by TextDocumentSyncKind.Full, as we're sending the full document over the connection on each document change, the whole document is rebuilt entirely on every keystroke, it's not scaling well.
For now, we'll call it a known limitation, but we'll have to work on improving performance once we get the initial features right.
from lemminx.
@NikolasKomonen thanks for testing that and attached your large file.
Anyways, I think we're getting murdered by TextDocumentSyncKind.Full, as we're sending the full document over the connection on each document change, the whole document is rebuilt entirely on every keystroke, it's not scaling well.
Indeed I think it can be a problem, and it was my fear, because we need to manage "incremental" parser which is an hard task I think.
BUT I have started to study the problem, and building the XMLDocument directly from the given file takes 1590 ms which is too big. It seems the problem comes from the regexp. I will give you feedback and try to fix the problem.
from lemminx.
from lemminx.
@NikolasKomonen I have improved performance, your large file takes 195 ms instead of 1590 ms!
Please give me feedback.
from lemminx.
@angelozerr awesome work! This makes the extension much snappier!!!
did you use a profiler or just noticed that substring hanging there?
Are there other places where substring/string concatenation might be hurting us?
from lemminx.
@angelozerr awesome work! This makes the extension much snappier!!!
Glad it pleases you:) I think now we have the same performance than HTML Language Server.
did you use a profiler or just noticed that substring hanging there?
To be honnest with you, I'm not very familiar with profiler, I have just noticed this hang (at first I though it was because of regexp, but it was about String#substring)
Are there other places where substring/string concatenation might be hurting us?
I have tried to check that, but I think it's OK. The main problem is to do a substring from a position to string length (it creates a very large String each time, using Matcher#region locate just the matcher. We could use the same Matcher too, but it seems that it doesn't improve performance.
from lemminx.
@angelozerr This is awesome, great find.
from lemminx.
Thanks guys!
from lemminx.
Here's a site to find xml documents of various sizes, some pretty big: http://aiweb.cs.washington.edu/research/projects/xmltk/xmldata/
Tried with a 30MB doc in vscode. Never reached the point where I got error reported. I'll try with incremental support later
from lemminx.
Here's a site to find xml documents of various sizes, some pretty big: http://aiweb.cs.washington.edu/research/projects/xmltk/xmldata/
Cool!
Tried with a 30MB doc in vscode. Never reached the point where I got error reported. I'll try with incremental support later
Could you give me the link of your xml that you are testing please.
from lemminx.
Seems the server chokes on the nasa.xml from http://aiweb.cs.washington.edu/research/projects/xmltk/xmldata/www/repository.html#nasa
Tried with xmx2GB
from lemminx.
@fbricon I have added the nasa.xml in the test:
- for largeFile.xml:
Parsed 'largeFile.xml' with XMLScanner in 31 ms.
Parsed 'largeFile.xml' with XMLParser in 25 ms.
- for nasa.xml:
Parsed 'nasa.xml' with XMLParser in 731 ms.
Parsed 'nasa.xml' with XMLScanner in 371 ms.
from lemminx.
try validation, formatting, hover...
from lemminx.
try validation, formatting, hover...
Yes sure we need too add thoses tests. But if creation of XMLDocument takes 731ms, I think we will have slow problem.
WTP XML Editor cannot open it too your nasa.xml.
I fear that it will very hard to support very large file. I think a problem is because it's not incremental. Have you tried with "experimental" incremental support?
from lemminx.
I close this issue since 0.8.0 improves performance and memories and gives the capability to disable outline.
from lemminx.
Related Issues (20)
- Improve XML references pattern
- Improve completion based on grammar with snippets HOT 2
- Prepare for 1.0.0 Release HOT 4
- NullPointerException in `documentColor`
- Provide cancel support for hover
- Supported URI-Schemes in Catalog-Files HOT 5
- Is `formatFull()` exposed in JSON-RPC? HOT 1
- DidChangeConfigurationParams message overwrites initialization of root logger handler HOT 1
- Partial formating yields wrong intendation deep HOT 14
- RNG attribute completion doesn't generate the proper prefix if the namespace is not declared
- Comments throws off diagnostic (cvc-complex-type.2.3) mark onto the wrong location HOT 8
- bump LSP4J version 0.14.0 to 0.20.1 HOT 3
- AutoOpen closed Tags HOT 1
- conform spec: shutdown response does not conform to language-server spec HOT 2
- Missing diagnostics messages HOT 7
- Configurable path to cache directory (or using XDG dirs) HOT 2
- Cache refreshing HOT 2
- Allow code actions to be created if no Diagnostics is provided
- TextDocument to expose an API for getting a document line number by offset
- `IRenameParticipant.doRename()` is not conform with LSP-defined rename result
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lemminx.