Home | History | Annotate | Line # | Download | only in Examples
      1 The following are examples of js_cpudist.d.
      2 
      3 This script traces the on-CPU time of JavaScript functions and prints a report 
      4 in the form of a histogram.  Here it traces the example program,
      5 Code/JavaScript/func_clock.html 
      6 
      7 # js_cpudist.d
      8 Tracing... Hit Ctrl-C to end.
      9 ^C
     10 
     11 Elapsed times (us),
     12    func_clock.html, obj-new, Date 
     13            value  ------------- Distribution ------------- count    
     14                2 |                                         0        
     15                4 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4        
     16                8 |                                         0        
     17 
     18 
     19 Exclusive function on-CPU times (us),
     20    func_clock.html, func, setTimeout 
     21            value  ------------- Distribution ------------- count    
     22               16 |                                         0        
     23               32 |@@@@@@@@@@@@@@@@@@@@                     2        
     24               64 |@@@@@@@@@@@@@@@@@@@@                     2        
     25              128 |                                         0        
     26 
     27    func_clock.html, func, getElementById 
     28            value  ------------- Distribution ------------- count    
     29                4 |                                         0        
     30                8 |@@@@@@@@@@                               4        
     31               16 |@@@@@@@@@@                               4        
     32               32 |@@@@@@@@@@@@@@@@@@@@                     8        
     33               64 |                                         0        
     34 
     35    func_clock.html, func, start 
     36            value  ------------- Distribution ------------- count    
     37              256 |                                         0        
     38              512 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4        
     39             1024 |                                         0        
     40 
     41    func_clock.html, func, func_a 
     42            value  ------------- Distribution ------------- count    
     43             8192 |                                         0        
     44            16384 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4        
     45            32768 |                                         0        
     46 
     47    func_clock.html, func, func_b 
     48            value  ------------- Distribution ------------- count    
     49            16384 |                                         0        
     50            32768 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4        
     51            65536 |                                         0        
     52 
     53    func_clock.html, func, func_c 
     54            value  ------------- Distribution ------------- count    
     55            16384 |                                         0        
     56            32768 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4        
     57            65536 |                                         0        
     58 
     59 
     60 Inclusive function on-CPU times (us),
     61    func_clock.html, func, setTimeout 
     62            value  ------------- Distribution ------------- count    
     63               16 |                                         0        
     64               32 |@@@@@@@@@@@@@@@@@@@@                     2        
     65               64 |@@@@@@@@@@@@@@@@@@@@                     2        
     66              128 |                                         0        
     67 
     68    func_clock.html, func, getElementById 
     69            value  ------------- Distribution ------------- count    
     70                4 |                                         0        
     71                8 |@@@@@@@@@@                               4        
     72               16 |@@@@@@@@@@                               4        
     73               32 |@@@@@@@@@@@@@@@@@@@@                     8        
     74               64 |                                         0        
     75 
     76    func_clock.html, func, func_c 
     77            value  ------------- Distribution ------------- count    
     78            16384 |                                         0        
     79            32768 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4        
     80            65536 |                                         0        
     81 
     82    func_clock.html, func, func_a 
     83            value  ------------- Distribution ------------- count    
     84            32768 |                                         0        
     85            65536 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4        
     86           131072 |                                         0        
     87 
     88    func_clock.html, func, func_b 
     89            value  ------------- Distribution ------------- count    
     90            32768 |                                         0        
     91            65536 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4        
     92           131072 |                                         0        
     93 
     94    func_clock.html, func, start 
     95            value  ------------- Distribution ------------- count    
     96            32768 |                                         0        
     97            65536 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4        
     98           131072 |                                         0        
     99 
    100 The first section, Exclusive function on-CPU times, shows us the time spent
    101 on-CPU by various functions, not including time spent in subroutines.  You can
    102 see here that func_a had four instances of being on-CPU between 16384
    103 microseconds and 32767 microseconds.
    104 
    105 The second section, Inclusive function on-CPU times, shows us the time spent
    106 on-CPU by various functions, including that time spent in subroutines called
    107 by those functions.  You can see that here func_a had four instances of being 
    108 on-CPU between 65536 microseconds and 131071 microseconds.
    109 
    110 It is important to pay close attention to the third column, "count" as this
    111 will indicate if there were any instances in a particular timeframe, even if
    112 the number is too small to show up on the histogram clearly.
    113