Investigation: downsides of being generic and correct

Juan Manuel Cabo juanmanuel.cabo at gmail.com
Thu May 16 18:01:38 PDT 2013


On Thursday, 16 May 2013 at 22:58:42 UTC, 1100110 wrote:
> On 05/16/2013 01:46 PM, Nick Sabalausky wrote:
>> On Thu, 16 May 2013 09:03:36 -0500
>> 1100110 <0b1100110 at gmail.com> wrote:
>> 
>>>> May I also recommend my tool "avgtime" to make simple 
>>>> benchmarks,
>>>> instead of "time" (you can see an ascii histogram as the 
>>>> output):
>>>>
>>>>      https://github.com/jmcabo/avgtime/tree/
>>>>
>>>> For example:
>>>>
>>>> $ avgtime -r10 -h -q  ls
>>>> ------------------------
>>>> Total time (ms): 27.413
>>>> Repetitions    : 10
>>>> Sample mode    : 2.6 (4 ocurrences)
>>>> Median time    : 2.6695
>>>> Avg time       : 2.7413
>>>> Std dev.       : 0.260515
>>>> Minimum        : 2.557
>>>> Maximum        : 3.505
>>>> 95% conf.int.  : [2.2307, 3.2519]  e = 0.510599
>>>> 99% conf.int.  : [2.07026, 3.41234]  e = 0.671041
>>>> EstimatedAvg95%: [2.57983, 2.90277]  e = 0.161466
>>>> EstimatedAvg99%: [2.5291, 2.9535]  e = 0.212202
>>>> Histogram      :
>>>>     msecs: count  normalized bar
>>>>       2.5:     2  ####################
>>>>       2.6:     4  ########################################
>>>>       2.7:     3  ##############################
>>>>       3.5:     1  ##########
>>>>
>>>> --jm
>>>>
>>>
>>> Thank you for self-promotion, I miss that tool.
>>>
>>>
>> 
>> Indeed. I had totally forgotten about that, and yet it 
>> *should* be the
>> first thing I think of when I think "timing a program". IMO, 
>> that
>> should be a standard tool in any unixy installation.
>> 
>> 
>
> +1
>
> That's worth creating a package for.

Thanks!
I currently don't have much time to make a ubuntu/arch/etc. 
package, between work and the university. I might in the future.

Keep in mind that it also works in windows. Though the process 
creation overhead is bigger in windows than in linux (because of 
the OS). Also, you can open the source up and easily modify it to 
measure your times directly, inside your programs.

--jm



More information about the Digitalmars-d mailing list