diff options
author | rodri <rgl@antares-labs.eu> | 2024-09-04 11:09:42 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2024-09-04 11:09:42 +0000 |
commit | 45a4d2223e1cf7fe6a393d49bb2d6b5b55425580 (patch) | |
tree | 4396b0902ed116a1a9407c53e52adead7d705c25 /proffillpix | |
parent | f1904837d4899a92c0beeef674a4efe772b2534d (diff) | |
download | threadpool-45a4d2223e1cf7fe6a393d49bb2d6b5b55425580.tar.gz threadpool-45a4d2223e1cf7fe6a393d49bb2d6b5b55425580.tar.bz2 threadpool-45a4d2223e1cf7fe6a393d49bb2d6b5b55425580.zip |
add a profiling helper script (thanks sirjofri!)
Diffstat (limited to 'proffillpix')
-rwxr-xr-x | proffillpix | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/proffillpix b/proffillpix new file mode 100755 index 0000000..7473a3c --- /dev/null +++ b/proffillpix @@ -0,0 +1,28 @@ +#!/bin/rc +# written by sirjofri, with slight modifications. +rfork en + +fn usage { + echo usage: $0 prog [args] >[1=2] + exit usage +} + +if(~ $#* 0) + usage + +ramfs +cp $1 /tmp +cd /tmp + +$* >/dev/null >[2=1] + +{ + for(f in prof.*){ +# flambe $1 $f + prof $1 $f | grep fillpix + } +} | awk '{ sum += $2; count++; print } +END{ + printf "sum: %.9f\n", sum; + printf "avg: %.9f\n", sum / count; +}' |