VB Watch Profiler: Source view

The source code view is a powerful tool for analyzing your code's performance. Click the source tab to display the source code view.

 

Time mode

Lines of code are colored depending on their nature and performance.

The left margin displays profile data (selectable in the toolbar - see below).

 

Coverage mode

You can easily identify portions of code that were never executed and that are likely to contain errors.

The line in red was never executed. The left margin displays the number of time each line was executed.

 

Context menu

Left click on a procedure or module to pop up a context menu that allows to jump to the flowchart view, or even load the original source and pinpoint the item in the original source code !

 

Special case: End Sub/ End Function/ End Property/ Exit Sub/ Exit Function/ Exit Property

These lines that causes to exit the procedure are profiled but not included in the procedure total time, nor are they displayed in the data view (except in Coverage display mode).

This is because it is not very useful in most cases: if you just load a form and then wait 30 seconds before doing anything, the End Sub line of the Form_Load event will be credited of 30 seconds. It doesn't help profiling your code but instead makes things confused. The only case in which it would be useful is with callbacks, since many time may be spent "outside the procedure".

So you will only find this data in the source view: displayed in blue, small font and in brackets. The line is considered as neutral, thus always colored in blue, no matter what its value is. Example:

After resizing its form, the user waited 4.69 secs before doing something else...

 

Toolbar

Print Preview: displays the Print Preview dialog (using Internet Explorer built-in function)

Print: prints the current HTML page (using Internet Explorer built-in function)

Save: saves the HTML source code of the current page

Profile Data: determines which columns of value should be displayed. The Profiler remembers your last choice for each display mode.

Colors: brings this Options dialog.

No color- Color by % - Color by Value: determines criteria for coloring lines of code. Detailed info is given at bottom of the page.

Font attributes: sets font attributes for the current HTML page