Tk Library Source Code

View Ticket
Login
Ticket UUID: 1747945
Title: Patch to avoid inflation of the 'statTime' array
Type: Patch Version: None
Submitter: dzach Created on: 2007-07-04 17:41:13
Subsystem: profiler Assigned To: nobody
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2013-07-04 17:25:38
Resolution: Not Applicable Here Closed By:
    Closed on:
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.
User Comments: dzach added on 2007-07-05 00:41:15:

File Added - 235687: patch0.patch

Attachments: