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.
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
changing milestone
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.