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 121569 - Snapshot results differ with Live Results
Summary: Snapshot results differ with Live Results
Status: RESOLVED WONTFIX
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 6.x
Hardware: PC All
: P3 blocker (vote)
Assignee: issues@profiler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-09 13:28 UTC by Maksim Khramov
Modified: 2008-09-03 14:56 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maksim Khramov 2007-11-09 13:28:47 UTC
NetBeans build 200711081200
Java 1.6.0_03

I Perform CPU profiling for java class:
Option to instrument empty methods should be turned on.

public class Main {
     public static void EmptyMethod() {
     }
     public static void main(String[] args) {
        for(long i=0;i<10000000;i++) {
            EmptyMethod();
        }
    }
}
Take snapshot after it finised.
I see two different results in Live Results and in Snapshot Window
Live Results window:
Method main takes 61,4% of time
Method EmptyMethod takes 38,6% of time
CPU Snapshot window:
Method main self time takes 43,8% of time
Method EmptyMethod takes 27,6% of time
Comment 1 J Bachorik 2008-03-29 11:41:11 UTC
changing milestone
Comment 2 J Bachorik 2008-09-03 14:56:45 UTC
The problem is that with the empty method you are effectively measuring the profiler instrumentation. In such an extreme
case cleansing of the introduced overhead doesn't work very well - this is by design and won't be changed.