Sw4   >   Misc   >   Performance Testing

Performance Testing

A Programmer_Task is availalbe to developer for testing and improving performance of methods.

There are two Programmer Menu items used to interface with the programmer task millisecond timecount functions.

  1. Programmer Timecount (on/off) - Selecting this menu item toggles the timecount counter. When the menu is checked the timecount is on.
  2. Programmer Timecount Log - Use this menu item to look at the timecount log results window. You can leave the window open. Each time it comes to the top, the list in the window is updated.

If you have a method or series of method you want to check to find out where the greatest performance hit is taking place, do the following.

  1. Turn the Programmer Timecount on by selecting the menu item so that it is checked.
  2. Add $logTimer message to various places in your methods where you want to capture the time.
  3. Put a 'begin' $logTimer message at the beginning of the method

    Do $itasks.Programmer_Task.$logTime($cmethod,'begin')

  4. Put an 'end' $logTimer message at the end of the method

    Do $itasks.Programmer_Task.$logTime($cmethod,'end')

  5. You can also put a 'begin added comment' and 'end added comment' $logTimer messages at various points in any method.

    Do $itasks.Programmer_Task.$logTime($cmethod,'begin')

    Do $itasks.Programmer_Task.$logTime($cmethod,'begin SQL fetch')
    Do List.$getAllRecords() Returns FlagOK
    Do $itasks.Programmer_Task.$logTime($cmethod,'end SQL fetch')

    If FlagOK
       Do $itasks.Programmer_Task.$logTime($cmethod,'begin loop')
       For List.$line from 1 to List.$linecount step 1
          ; Do some stuff.
       End For
       Do $itasks.Programmer_Task.$logTime($cmethod,'end loop')
    End If

    Do $itasks.Programmer_Task.$logTime($cmethod,'end')
    Quit method FlagOK

  6. Run the method(s).
  7. Select the Programmer Timecount Log menu item to look at the results.
  8. Run the same method or series of methods several times to compare the results.
  9. You can then zero in on the methods or parts of methods which are taking the greatest amount of time.