History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEA-19235
Type: Performance Problem Performance Problem
Status: Open Open
Assignee: Nikolay Chashnikov
Reporter: Michael Morett
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IDEA: Feedback

Compare with Clipboard: making changes to code in Diff Comparison extremely sluggish

Created: 20 Aug 08 10:31   Updated: 27 Aug 08 23:42
Component/s: Diff/Merge

File Attachments: 1. Zip Archive 8733_mmorett_26.08.2008_12.44.38.zip (5.56 Mb)
2. Zip Archive 8733_mmorett_27.08.2008_12.18.37.zip (4.39 Mb)

Environment: Vista with 6GB

Build: 8,660


 Description  « Hide
Any keystrokes/changes in the Diff Comparison window take approximately 20 seconds to resolve. Prior versions of IDEA would resolve/re-compare the changes immediately.

The files in question are JSPs with (unfortunately) lots of Java code and approximately 1600 lines long each (unfortunately for me as I had to inherit and work on these files).

I have not tried to perform the same editing/diff comparisons on large .java files (normal classes) so the problem may only be apparent in JSPs.



 All   Comments   Work Log   Change History      Sort Order:
Dmitry Jemerov - 20 Aug 08 12:12
Please take a CPU snapshot while performing these changes, as described in http://support.jetbrains.com/kb/entry.jspa?externalID=192&categoryID=5

Michael Morett - 26 Aug 08 23:52
CPU snapshot added.

Dmitry Jemerov - 27 Aug 08 11:46
The problem visible in the snapshot isn't related to "Compare with Clipboard" - rather the problem is with JSP include processing triggered from the "Redundant cast" inspection.

Michael Morett - 27 Aug 08 23:24
I'm attaching a different CPU snapshot which may shed some light on the problem.

1. I chose two different JSPs to Compare with Clipboard. (this CPU sluggishness only occurs when Diff'ing JSPs – ad hoc testing never shows a problem comparing two Java classes)

2. All I did in the Diff screen was add 4 spaces (to force a re-compare).

It took about 15-18 seconds to return control and show the newly added 4 spaces.


Michael Morett - 27 Aug 08 23:25
I should also mention that my PC now has 6GB of memory.

Michael Morett - 27 Aug 08 23:42
More info: I tried Compare with Clipboard with two relatively smaller JSPs and didn't experience the sluggishness I noticed with the two larger JSPs.

The problematic JSPs are about 2000 lines long and include a mixture of JSP scriptlets, JSP expressions, Javascript, HTML, some JSP @ includes. It's horrible code.

My theory – the sluggishness I see in the Compare with Clipboard is because it blocks when trying to re-evaluate/analyze the code in order to display the tick marks on the right side. I noticed that any changes to the JSP in normal edit mode (not Compare with Clipboard) show nearly the same amount of time to finally display the "little red box" (or yellow box or green box in the upper right part of the screen). The main difference is – I can keep editing the JSP without any delays (although I won't know the results of the code analysis).

In the Compare with Clipboard screen, every edit blocks until a full analysis is done on the code.

Given a choice, when I am doing a Compare with Clipboard, I am much more concerned with the Diff-related tick marks and not the Java code syntax related tick marks. The reason I am using Compare with Clipboard in my case is precisely because this code is horrible – I am trying to refactor it down to size and otherwise improve it.

Because Compare with Clipboard blocks on all edits, I almost have to split the window and do manual comparisons and edits (because normal JSP editing does not block).

Hope that helped.