Bug 25516 - Stepping takes > 2 seconds
Summary: Stepping takes > 2 seconds
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 2.0   Edit
Hardware: PC Linux-GTK
: P2 major (vote)
Target Milestone: 2.1 M4   Edit
Assignee: Darin Wright CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
: 26973 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-10-29 15:49 EST by Jared Burns CLA
Modified: 2002-12-30 16:06 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jared Burns CLA 2002-10-29 15:49:36 EST
Build 20021029 (and 20021022)

I'm trying to debug Eclipse's Ant core, but it takes me more than 2 seconds for each step.

1. Place a breakpoint in AntRunner.getAvailableTargets().
2. Debug to the breakpoint and try to step a few times.
3. The step takes more than 2 seconds, during which my CPU is pegged at 100%. This happens for all steps, even stepping over the following:
List infos= (List) results;
Comment 1 Jared Burns CLA 2002-10-30 12:29:21 EST
The problem only occurs with Step Over.
Comment 2 Darin Wright CLA 2002-11-12 11:25:06 EST
Need to address if this is still an issue.
Comment 3 Darin Wright CLA 2002-11-22 11:27:37 EST
*** Bug 26973 has been marked as a duplicate of this bug. ***
Comment 4 Darin Wright CLA 2002-11-22 11:29:05 EST
(performance issue)
Comment 5 Jerry Quinn CLA 2002-11-24 16:04:31 EST
This is definitely an issue.  I have a very fast machine (dual 2.4GHz), but
stepping is still over a second.  While stepping, there is a LOT of redraw
activity going on in the stack trace window.  This is with the latest M3 build.
 Step-into is just as slow when not descending into a subroutine.

JDK is IBM 1.3.1, platform is RH8.0
Comment 6 Jared Burns CLA 2002-11-24 17:00:37 EST
An important thing to mention is that the views (debug view, variables view,
etc.) update immediately. It seems to be the editor that is lagging behind.
Could this be related to the instruction pointer?
Comment 7 Luc Bourlier CLA 2002-11-25 11:55:33 EST
Do you still see this issue with the latest build (20021119) ?

It is certainly still possible to increase the performance, but I no more get
the "> 2 seconds" problem.
Comment 8 Jerry Quinn CLA 2002-11-26 10:02:36 EST
I20021119 won't run for me, so I can't test the stepping.  When trying to
launch, I get:

java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Widget
Comment 9 Jerry Quinn CLA 2002-11-26 10:23:29 EST
I20021119 still has the exact same behavior.  1 second per step-over.
Comment 10 Luc Bourlier CLA 2002-12-06 14:44:13 EST
I filled a bug against GTK (bug 27862).
Comment 11 Jared Burns CLA 2002-12-10 10:11:33 EST
The root of the problem in our code is in 
LaunchViewEventHandler#handleSuspendThreadEvent(...). This method tries to
be clever about only refreshing the tree, but it looks like our efforts are
just slowing things down. Currently, the method says that if the number of
stack frames has changed (as in a StepIn or StepReturn), we refresh the
entire thread. If the number of frames hasn't changed (as in a StepOver), we
refresh each stack frame instead. This code (refreshing each stack frame
individually) is the problem. As explained in Bug 27862, this causes 
setSelection() to be called for each stack frame. On GTK, setSelection() is
apparently very slow.

The GTK bug needs to be addressed by the SWT team, but I think we should
also reexamine our "clever" code in the event handler. We're doing a lot of
work to figure out which frames need to be refreshed. If this code is
hurting performance significantly (and it is), we should yank it.
Comment 12 Jared Burns CLA 2002-12-10 13:06:07 EST
Fixed. By removing our witty code, stepping performance has been improved
dramatically.

Please verify.
Comment 13 Darin Wright CLA 2002-12-10 15:02:29 EST
Verified. Stepping is much faster.
Comment 14 Jerry Quinn CLA 2002-12-30 16:06:21 EST
I also verify that stepping is much improved.  There is still a visible lag but
not much.