Bug 544677 - Change implementation of Step over by using Run to Line
Summary: Change implementation of Step over by using Run to Line
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.11   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-21 10:48 EST by Robert Müller CLA
Modified: 2019-02-22 00:22 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Müller CLA 2019-02-21 10:48:49 EST
The root-problem is this one: https://stackoverflow.com/questions/28807452/slow-java-debugging-performance-in-long-running-method/54805259#54805259
Basically the Step Over instruction in the Java debugger is insanely slow in some situations. For instance I have a String with about 4 million characters that I am applying a replace-action to (String.replace()). When running the code normally it takes a fraction of a second. But when trying to step over this line, it takes roughly 20 seconds which is unacceptably long.

I believe that this is due to the way the debugger works (https://stackoverflow.com/questions/2195720/why-does-java-code-slow-down-in-debugger) so I guess Eclipse is not to blame for that.

I did also experience that when placing the cursor on the line after the replace and using Run to Line (Ctrl+R) it also only takes a fraction of a second (same applies to adding a breakpoint after the replace and hitting F8 (Continue)).
Therefore I thought it might be an idea to provide a functionality similar to Step Over that uses Run to line under the hood. This would provide the usability of the Step Over command but with the speed of the Run to Line command.

In the most trivial implementation it would put the cursor one line down and invoke Run to line.

I also suggested this on StackOverflow (https://stackoverflow.com/questions/54805459/eclipse-debugging-turn-step-over-to-run-to-next-line/54809277#54809277) where some considerations on such an implementation where pointed out.
Comment 1 Sarika Sinha CLA 2019-02-22 00:22:10 EST
It might be a good idea to try this out, if someone is ready to provide a quality patch we can look into it.