shellprof icon indicating copy to clipboard operation
shellprof copied to clipboard

Profile a shell script based on its printouts

This is a shell script profiler.

shellprof will run your program, and when the program finishes shellprof will create a top list of which lines were shown the longest.

~/s/shellprof (master|✔) $ ./shellprof ./testcase.sh
quick
slow
quick

Timings for printed lines:
1.01s: slow
0.00s: <<<PROGRAM START>>>
0.00s: quick
0.00s: quick
~/s/shellprof (master|✔) $

Usage

shellprof my-program --whatever --flags --myprogram --wants

Development

Run tox && ./shellprof ./testcase.sh to lint and test the code.

For ease of distribution, shellprof only depends on the Python standard library.