The Performance Dip provides information on how long is spent when invoking a method, setting a property, or firing an event within a JavaBean. It works by determining the time in milliseconds immediately before a method is invoked, a property is set, or an event is fired, then again determining the time in milliseconds immediately after the corresponding method is invoked, property is set, or event is fired, then subtracting the two values and outputting the elapsed time to the Output Log. The output location and logging level for the timing messages is configurable, by redirecting the Output LogStream, via the Logging page of the com.ibm.beans.util.Configure application. Nested and recursive method calls are supported, with the time output for a method including the time spent in any other methods it might have invoked. Of course, there is a small impact upon the performance of any beans dipped in the Performance Dip, so it is recommended that this dip be used primarily in development, tuning, and debugging environments, and generally not be applied to beans deployed to end users.
Following is an example of the output of the Performance Dip when applied to the ImageViewer bean. This is the output produced when choosing to load a new image from the bean's popup menu.
60 milliseconds spent firing mouse event
1100 milliseconds spent in public void com.ibm.beans.samples.media.ImageViewer.mouseReleased(java.awt.event.MouseEvent)
7740 milliseconds spent in public java.lang.String com.ibm.beans.samples.media.ImageViewer.chooseImageFile()
50 milliseconds spent setting fileName
7850 milliseconds spent in public void com.ibm.beans.samples.media.ImageViewer.loadImage()
7910 milliseconds spent in public void com.ibm.beans.samples.media.ImageViewer.actionPerformed(java.awt.event.ActionEvent)
On some implementations of Java, the clock is only accurate to about 10 milliseconds. Methods that execute in less time than this threshold may have a time of 0 milliseconds reported.
When testing the Performance Dip with visible beans from within the Assembly Surface Tool, a deadlock situation can occur if both the Log view is open and the Layout view are open. This problem occurs if the bean attempts to draw at the same time as the timing message is being output to the log. To avoid this potential problem, do not have the Log view and the Layout view open at the same time. This problem only occurs within the Assembly Surface tool, and will not occur when the dipped bean is deployed.
Particularly for visual beans, the log may contain timing information on more methods, properties, and events than desired. If you would like to only receive timing information on methods from your immediate class, and not consider methods inherited from ancestor classes, then clear the "Dippable class overrides parents method(s)" checkbox on the Advanced Customization page of the morphing dialog when morphing the bean to which the dip will be applied.