Bug 48753 - [Responsiveness] Editor freezes while inserting code in large compilation unit
Summary: [Responsiveness] Editor freezes while inserting code in large compilation unit
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 major (vote)
Target Milestone: 3.0 M7   Edit
Assignee: Tom Hofmann CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2003-12-15 10:00 EST by Philipe Mulet CLA
Modified: 2004-01-19 05:21 EST (History)
0 users

See Also:


Attachments
2 dumps of activity during editor freeze (33.15 KB, text/plain)
2003-12-15 10:01 EST, Philipe Mulet CLA
no flags Details
Offending large compilation unit being edited (479.57 KB, text/plain)
2003-12-15 10:05 EST, Philipe Mulet CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2003-12-15 10:00:57 EST
Build 20031211

When editing type org.eclipse.jdt.core.tests.compiler.regression.NegativeTest, 
which contains 405 methods, the editor froze for a couple of minutes after a 
paste action.

See below a dump of the offending activity:
Comment 1 Philipe Mulet CLA 2003-12-15 10:01:42 EST
Created attachment 7161 [details]
2 dumps of activity during editor freeze
Comment 2 Philipe Mulet CLA 2003-12-15 10:02:31 EST
Note that my machine is a P3 1.2GHz, 1Gb of RAM, JDK 1.4.1_05.
Comment 3 Philipe Mulet CLA 2003-12-15 10:05:01 EST
Created attachment 7162 [details]
Offending large compilation unit being edited
Comment 4 Philipe Mulet CLA 2003-12-15 10:07:06 EST
I was intending to paste:

,
		null,
		true,
		customOptions);

near the end of the unit.
Comment 5 Tom Hofmann CLA 2003-12-15 11:49:52 EST
stack trace implies activity in JavaAutoIndentStrategy.smartIndentAfterNewLine.
It gets only called after a single line delimiter has been inserted which you
apparently did not do. This is strange.

- Are you sure you did not press 'return' before you got the dumps?
- Pasting and inserting a new line (with smart paste on) can be expensive since
the current algo searches for matching parenthesis (brackets, braces) that can
be far away. We probably need to cap the search distance there.
Comment 6 Philipe Mulet CLA 2003-12-15 11:58:24 EST
I don't think I had pressed the return key, but wouldn't bet to hard on it. The 
pasted code did contain line separators though.

Also, none of the smart editor behavior is enabled in my settings (except for 
close Javadoc comments).
Comment 7 Tom Hofmann CLA 2003-12-15 12:17:07 EST
its definitely happening during auto-indentation. I'll try to reproduce.
Comment 8 Philipe Mulet CLA 2003-12-15 12:26:22 EST
Note that the org.eclipse.jdt.core.tests project is not public, and lives on 
snz1f. Dirk knows how to access it.
Comment 9 Tom Hofmann CLA 2004-01-07 13:05:27 EST
modified the smart pasting (called "pasting for correct indentation" in the
prefs) code to be much faster - can you check whether this solves the problem?

The stack traces point into a different direction, but since you said it was
when pasting, this might still be it (see also bug 49437)
Comment 10 Tom Hofmann CLA 2004-01-19 05:21:15 EST
Closing as there have been fixes with smart pasting. please reopen if you still
see this problem.