Bug 90870 - [breakpoints] enhance method exit breakpoint performance
Summary: [breakpoints] enhance method exit breakpoint performance
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P5 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-08 17:55 EDT by Darin Wright CLA
Modified: 2013-07-12 09:24 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Wright CLA 2005-04-08 17:55:08 EDT
We may be able to enhance method exit breakpoints by converting the method 
exit request to line breakpoints on corresponding return statements. Would 
require use of AST to locate return statements.
Comment 1 Darin Wright CLA 2005-04-11 09:38:59 EDT
Deferred
Comment 2 Darin Wright CLA 2007-06-12 14:40:21 EDT
Could also benefit from this pending feature: "Add a method filter to MethodEntryRequest and MethodExitRequest"

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6447614
Comment 3 Denis Roy CLA 2009-08-30 02:21:04 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.
Comment 4 Markus Keller CLA 2013-05-27 13:21:12 EDT
Reopening, request is still valid.

I just wanted to use a MethodExit breakpoint on java.util.Arrays#sort(Object[]) to find broken compare implementations. But it was unusably slow, probably due to the abundance of calls to Arrays#copyOf(..).

Fortunately, I could reuse the breakpoint condition and just use it in line breakpoints at the end of java.util.ComparableTimSort#sort(Object[], int, int) and on the early returns of that method. That performed well.

Object[] sorted= arg0;
int l = sorted.length;
for (int i= 0; i < l; i++) {
    for (int j= 0; j < l; j++) {
        Comparable oi= (Comparable) sorted[i];
        Comparable oj= (Comparable) sorted[j];
        int c= oi.compareTo(oj);
        if (i < j) {
            if (c > 0 || c == 0 && !oi.equals(oj)) {
            	System.out.println(i+","+j+","+c+ "\n"+oi + "\n"+oj);
            	return true;
            }
        } else if (i == j) {
            if (c != 0) {
            	System.out.println(i+","+j+","+c+ "\n"+oi + "\n"+oj);
            	return true;
            }
        } else {
            if (c < 0 || c == 0 && !oi.equals(oj)) {
            	System.out.println(i+","+j+","+c+ "\n"+oi + "\n"+oj);
            	return true;
            }
        }
    }
}
return false;
Comment 5 Jan Poganski CLA 2013-07-12 09:24:17 EDT
I can confirm that code is executed many times slower when a method exit breakpoint is used.

Today I wanted to debug a void method which was ending with a for loop. As there was no statement after the loop where I could have set a checkpoint I decided to set a method exit breakpoint. The performance of the method slowed down so much that I even restarted my machine because I could not explain what was going on. During the next debug session I was waiting once more for the loop to finish an I decided to deselect the Exit property of the breakpoint. Immediately the loop completed. This gave me a hint to search for this bug report.