This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 29560 - Stepping slowed down by unnecessary screen updates
Summary: Stepping slowed down by unnecessary screen updates
Status: CLOSED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 3.x
Hardware: PC Windows 95/98
: P3 blocker (vote)
Assignee: issues@debugger
URL: testcase
Keywords: PERFORMANCE, UI
Depends on:
Blocks: 27788
  Show dependency tree
 
Reported: 2002-12-14 05:49 UTC by bht
Modified: 2003-06-30 17:36 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Testcase demonstrating bug (673 bytes, text/plain)
2002-12-14 05:51 UTC, bht
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bht 2002-12-14 05:49:45 UTC
Version: Q-build 200211200100
JDK: 1.4.1

When stepping through Java source code, markers in
all higher level call hierarchies are being
updated  unnecessarily.

It appears that this leads to considerable delays
on slow computers and may even introduce other
instabilities, e.g. lost focus issues.

I have experienced several hard-to-reproduce cases
where the marker and the cursor on the current
level disappeared where it could be successfully
resored by clicking on the last (current) link in
the debugger console.

Also this creates screen flicker which is annoying.

Considering the above effects (especially the bug
which I have not entered into the system yet), and
the perceived simplicity of the fix, I am
suggesting a high priorty.
Comment 1 bht 2002-12-14 05:51:52 UTC
Created attachment 8336 [details]
Testcase demonstrating bug
Comment 2 _ pkuzel 2003-01-06 16:47:50 UTC
In JPDADebugger implementation is from steping method invoked
clearStackTraceAnnotations() that *unconditionally* clears all call
site annotations.

I guess that in typical scenario all but last one can be reused.

Unfortunatelly I have not found the code where new annotations are
added. Is it an asynchronous task that debugger steping does not
detect it? A callback?
Comment 3 _ pkuzel 2003-01-06 16:48:45 UTC
In JPDADebugger implementation is from steping method invoked
clearStackTraceAnnotations() that *unconditionally* clears all call
site annotations.

I guess that in typical scenario all but last one can be reused.

Unfortunatelly I have not found the code where new annotations are
added. Is it an asynchronous task that debugger steping does not
detect it? A callback?
Comment 4 _ pkuzel 2003-01-06 18:43:27 UTC
I see there JPDADebugger.updateUINow() that calls
JavaDebugger.annotateCallStack().

Is it OK to reimplement the annotateCallStack() to merge old and new
annotations and remove the clearStackTraceAnnotations()? Can occure
such a situation that updateUINow() is not called at all?
Comment 5 _ pkuzel 2003-01-07 13:41:10 UTC
Marian also mentioned that one possible solution is to postpone
annotation updates and batch them with 500ms delay. I could work but
it must not affect current PC annotation.
Comment 6 _ pkuzel 2003-01-07 14:06:51 UTC
In fact 500ms delay strategy is already implemented in
JavaDebugger.updateUI(). It means that either batching does not work
or step to step actions delay (i.e. F8 F8 keystroke delay) is longer
than 500ms. 

The second case is pretty possible on slow computers. Besides
annotation removal is not subject of batching. Only annotation
attaching is batched - it guaranties 500ms flicker in all situations!
and it also always occures when slowly/moderately stepping a code.

To remove 500ms flicker we must batch both removal and adding.

To improve performance we should reuse old annotations or cache
Location.getLine() if they prove to be expensive operations.
Comment 7 _ pkuzel 2003-01-07 16:10:59 UTC
Fast stepping flicker eliminated for step over and step into actions.
Going to implement merging to eliminate it for slow stepping too.
Comment 8 _ pkuzel 2003-01-07 16:39:04 UTC
Annotation are merged (actually code was in place but its effects were
invalidated by explicit call to clearStackTraceAnnotations() from
stepping methods).

I do not see any flicker anymore.
Comment 9 _ pkuzel 2003-01-13 13:03:08 UTC
Dusan please evaluate if this call-stack visualization is desired.
Compare it with content of call stack tab in debugger window.

I think that such visualization should be by default off. Reopen if
you conclude with the same result.

Also please evaluate how 500ms delay inpact users experience.
Comment 10 Quality Engineering 2003-06-30 17:34:39 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.
Comment 11 Quality Engineering 2003-06-30 17:36:45 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.