Description: |
This patch relates to the size of the statTime array.
In the existing package (v0.2.3) the statistics on proc execution times are performed on data collected in array 'statTime'. However, if the profiler is run for a length of time, this array is getting very big, which I believe slows down the profiler. I've seen this degradation of performance in a program that uses a lot of 'after time' calls. It looks like for the type of statistics performed with this package there is no need to collect all time samples in the array. With this patch the basic statistics ('mean' and 'sum of squared times') are performed in the 'leaveHandler' proc and the array space is kept small (two array variables -not lists- per profiled function). The calculation of 'sigma' and 'cov' is done when the user issues a ::profiler::print or ::profiler::dump command. I've measured a 6% increase in the execution time of 'leaveHandler' due to the performing of basic stats calculation in this proc.
|