Bug 558522 - Opening minified/one line files can cause severe lag
Summary: Opening minified/one line files can cause severe lag
Status: CLOSED WONTFIX
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.json (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Victor Rubezhny CLA
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2019-12-20 12:37 EST by Martin Lowe CLA
Modified: 2020-02-17 05:44 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Lowe CLA 2019-12-20 12:37:22 EST
When working with larger one-line/minified files (approaching 1mb), attempting to open the file in the generic text editor will display munged data and the IDE will slow down to a crawl. This persists until the file is closed or the IDE is restarted.

If the file is a JSON file and opened in the JSON editor, the entire IDE hangs and stops responding. I waited for a couple of minutes for the IDE to respond, but in the end, it needed to be closed. To reopen, I had to delete my workspace data as the file kept trying to reopen on start.
Comment 1 Gautier de SAINT MARTIN LACAZE CLA 2019-12-20 14:40:39 EST
About JSON Editor, is it the one from Web Tools Platform or the one from Wild Web Developer?
Comment 2 Lars Vogel CLA 2019-12-20 14:42:50 EST
Can you activate the UI Responsive Monitor in the preferences and post the freeze stack from the Error log?
Comment 3 Andrey Loskutov CLA 2019-12-20 14:50:26 EST
It is a known old GTK limitation with very long lines. There is SWT bug opened already, have no number at hand.
Comment 4 Martin Lowe CLA 2020-01-03 08:41:52 EST
(In reply to Gautier de SAINT MARTIN LACAZE from comment #1)
> About JSON Editor, is it the one from Web Tools Platform or the one from
> Wild Web Developer?

I had both installed on my system and reopened the file, and the IDE hung for a solid while still but managed to recover.
Comment 5 Martin Lowe CLA 2020-01-03 10:37:09 EST
(In reply to Lars Vogel from comment #2)
> Can you activate the UI Responsive Monitor in the preferences and post the
> freeze stack from the Error log?

UI freeze of 570s at 10:04:15.534
An exception stack trace is not available.

Sample at 10:12:47.107 (+170.500s)
Thread 'org.eclipse.wst.sse.ui.internal.reconcile.StructuredRegionProcessor' tid=645 (TIMED_WAITING)
Stack Trace
	at java.lang.Object.wait(Native Method)
	at org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor$BackgroundThread.run(DirtyRegionProcessor.java:670)

Session data:
eclipse.buildId=4.13.0.I20190916-1045
java.version=1.8.0_232
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_CA
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -data file:/home/martin/localdev/ -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product
Comment 6 Andrey Loskutov CLA 2020-01-07 09:51:29 EST
(In reply to Martin Lowe from comment #0)
> When working with larger one-line/minified files (approaching 1mb),
> attempting to open the file in the generic text editor will display munged
> data and the IDE will slow down to a crawl. This persists until the file is
> closed or the IDE is restarted.

Please attach your file and please specify *which editor exactly* was used to open it. Opening a simple file created via 

import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Arrays;
public class LongString {
	public static void main(String[] args) throws Exception {
		char[] longArr = new char[1_000_000];
		Arrays.fill(longArr, 'x');
		String s = new String(longArr);
		Path tempFile = Files.createTempFile("", "txt");
		System.out.println("File created: " + tempFile);
		Files.write(tempFile, s.getBytes());
	}
}

works for me on RHEL 7.4 in *default* simple text editor.
The line is not really editable due SWT limitations, but this is a different question. I assume your specific editor tries to parse the file content and fails to do so in a reasonable time.
Comment 7 Alexander Kurtakov CLA 2020-01-10 07:35:04 EST
This doesn't look like SWT issue. According to comment 5 it's coming from wtp.
Comment 8 Alexander Kurtakov CLA 2020-01-10 07:36:11 EST
For JSON editing I strongly recomment using https://marketplace.eclipse.org/content/eclipse-wild-web-developer-web-development-eclipse-ide instead of wtp.
Comment 9 Alexander Kurtakov CLA 2020-02-17 05:44:00 EST
Marking as closed. If you have similar issue with wildwebdeveloper please open corresponding issue.