-
Notifications
You must be signed in to change notification settings - Fork 56
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
Coloring exhibits quadratic behavior and blocks the SWT thread #540
Comments
What can be a good remediation? Just switching to ArrayList? Freel free to submit PRs for possible improvements. |
I am investigating that. |
Please try the latest snapshot from https://download.eclipse.org/tm4e/snapshots/ it contains the performance improvements I merged. |
Issue has been solved in latest snapshot build (confirmed by other parties). |
@sebthom I installed the latest nightly snapshot and still see a lot of time is spent here:
Steps:
If you're patient enough, a subsequent |
Because of #544 I am currently in the process of (probably) rewriting big parts of the model package. Once I got a handle on that either these issues are solved or I will have a second look at performance. Anyways, you should already see considerable improvements in the performance using the snapshot build. can you confirm that? |
Yes, I can confirm that opening editors for bigger jsons is a lot better. Editing larger chunks of data is still slow, though. Instead of doing the big rewrite, do you mind implementing the suggestion in #543 (comment) ? |
The changes you suggested are not necessary in that form in my rewrite. The UI thread will just need to add the information about the number of line changed to a queue. The insertion of ModelLine instances into the lines ArrayList (which can be expensive for large files), will then occur asynchronously in the tokenizer thread. |
@szarnekow please give the latest snapshot from download.eclipse.org/tm4e/snapshots a try. As suggested by you I changed the list modifying code to use List.subList() for deleting multiple lines at once. See https://github.com/eclipse/tm4e/blob/9b03a29dd214f5390aaf4f9fd05ed40d3a7b13ba/org.eclipse.tm4e.core/src/main/java/org/eclipse/tm4e/core/model/TMModel.java#L343 |
I tried to, but the installation failed:
|
Strange, well I bumped some versions and ran a rebuild. Can you try again please? |
@sebthom I managed to install the new version, but it looks like it's quite broken. Please watch the attached screen recording. Two notable things:
Screen.Recording.2023-06-24.at.15.27.30.mov |
@szarnekow thanks for taking the time to try out the release. I unfortunately cannot reproduce the issue. JSON editing works just fine for me even for large files such as https://github.com/json-iterator/test-data/blob/master/large-file.json. Two things: |
@sebthom the versions here show |
Opening a medium[1] sized JSON file in Eclipse might block the UI seemingly indefinitely due to
AbstractModelLines.getOrNull
which attempts query a linked list by index.Relevant part of the stack:
[1] To quantify this: 800k lines, 22MB; we might call it a big JSON file.
It shall be noted that a quick glance over AbstractModelLines.java indicates that almost all of the usages of the internal linked list are index based. It might warrant a refactoring of the entire class to avoid performance penalty that is imposed on all methods with the current data structure.
The text was updated successfully, but these errors were encountered: