Performance Monitoring


One of the essentials of achieving adequate performance is being able to measure what's run and how often, the ⎕MONITOR system function does the legwork, but can benefit from having a little code wrapped around it..

     SetMonitor←{⎕io ⎕ml←0 3
                 (⍳↑⍴⎕CR ⍵)⎕MONITOR ⍵}
     QueryMonitor←{⎕io ⎕ml←0 3
                 ('Line' 'Times' 'CPU' 'Elapsed' '' 'Code'),[0](⎕MONITOR ⍵),⊂[1]⎕CR ⍵}

Which we can use to examine a function called <SuDoku>...

      SetMonitor 'SuDoku'
      SuDoku ''
      QueryMonitor 'SuDoku'
 Line  Times  CPU  Elapsed     Code                                                                         
    0      1  250     2125  0   SuDoku w;⎕IO;⎕ML;⎕PATH;umode;utils;ureqd;olddog                             
    1      1    0        0  0  ⍝ Driver for the SuDoku Solver application                                   
    2      1    0        0  0   ⎕IO ⎕ML ⎕PATH←0 3 '↑ ⎕se.utils'                                             
    3      1   16       16  0   DogBoot DogBootFile                                                         
    4      1    0        0  0   olddog←⎕SRC #.DogLoader                       
...

Notes:


Page created 30 March 2009.
Copyright © Dogon Research 2009.