All Manuals > LispWorks IDE User Guide > 25 The Profiler

NextPrevUpTopContentsIndex

25.8 Some examples

The examples below demonstrate different ways in which the profiler can be configured and code profiled so as to produce different sets of results. In each example, the following piece of code is profiled:

(dotimes (x 1000)
  (capi:make-container
   (make-instance 'capi:title-pane
                  :text "Title")))

This is a simple form which makes some CAPI objects.

  1. Create a Profiler tool if you have not already done so.
  2. Copy the code above into the box in the Code to Profile panel.
  3. Choose Works > Tools > Preferences... or click , select Profiler in the list on the left side of the dialog, and then select the General tab. Now you can change the package of the Profiler.
  4. Figure 25.6 Profiler Preferences

  5. In the Profiler Preferences, replace the default package in the Package text box with CAPI and click .
  6. Click OK to dismiss the Preferences dialog and apply the change you have made.
  7. Click on Profile .
  8. This profiles the functions in the COMMON-LISP, CL-USER and LISPWORKS packages.

    Next, add the CAPI package to the list of packages whose functions are profiled.

  9. Click Packages .
  10. In the dialog, double-click on CAPI in the Unselected Packages list, and click on OK .
  11. Click on Profile to profile the code again.
  12. Notice that this time there are many more functions which appear in the profile results.

  13. Select a few of the functions listed at the top of the Results area, and look at their function descriptions.
  14. Add the Description area by clicking the Description >> button if you have not already done so.

    Notice that most of the functions appearing on the stack are in the CAPI package. It is worth profiling a few functions explicitly, and removing unwanted packages from the list of packages to profile.

  15. Click Symbols... , and add the following four functions to the list in the dialog:
  16. merge find-class make-char functionp

    Type the name of each function and press Return or click to add it to the list.

  17. Click OK when you have finished adding to this list.
  18. Now remove the unwanted packages from the list of packages to profile, as follows:

  19. Click Packages... .
  20. In the dialog click on None to remove all items in the Selected Packages list
  21. Click on OK , and profile the code again by clicking on Profile .

Notice that the four functions in the COMMON-LISP package are still being profiled, even though you are no longer profiling all functions from that package by default.

 


LispWorks IDE User Guide (Unix version) - 12 Feb 2015

NextPrevUpTopContentsIndex