time, need explicit pathThis is an old revision of the document!
Usage Profiling and benchmarking
/usr/bin/time 1) can report total run time (“clock on the wall”) and memory (RSS = Resident Set Size)
/usr/bin/time -v perl -e '"a"x(1024**3);' |& grep -Pi 'max|wall' # Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.40 # Maximum resident set size (kbytes): 1053908
When run with slurm, eg. Pittsburgh Super Computer
sacct -j $jobid --format=JobID,MaxRSS,AveRSS,TotalCPU,Elapsed
For smaller jobs, hyperfine runs many time for a more rigorous estimate.
hyperfine 'sleep .5' 'sleep .55'
Benchmark 1: sleep .5
Time (mean ± σ): 502.3 ms ± 0.6 ms [User: 1.6 ms, System: 0.8 ms]
Range (min … max): 501.7 ms … 503.2 ms 10 runs
Benchmark 2: sleep .55
Time (mean ± σ): 552.6 ms ± 0.5 ms [User: 1.5 ms, System: 1.0 ms]
Range (min … max): 551.8 ms … 553.4 ms 10 runs
Summary
sleep .5 ran
1.10 ± 0.00 times faster than sleep .55
1)
NB. not bash built-in