time /usr/bin/time -f "\n%E (hr:min:sec): Real time\n%S (sec): Total number of CPU-seconds used by the system on behalf of the process (in kernel mode)\n%U (sec): Total number of CPU-seconds that the process used directly (in user mode)\n%M kB: Max resident set size of the process during its lifetime\n%W: Number of times the process was swapped out of memory\n%P: Percentage of CPU that this job got." {{CMD}}
sync; echo 3 | sudo tee /proc/sys/vm/drop_caches
time /usr/bin/time -f "\n%E (hr:min:sec): Real time\n%S (sec): Total number of CPU-seconds used by the system on behalf of the process (in kernel mode)\n%U (sec): Total number of CPU-seconds that the process used directly (in user mode)\n%M kB: Max resident set size of the process during its lifetime\n%W: Number of times the process was swapped out of memory\n%P: Percentage of CPU that this job got." {{CMD}}
# sync - force completion of pending disk writes (flush cache)
# purge - force disk cache to be purged (flushed and emptied)
time-mac CMD:
sync && sudo purge
gtime -f "\n%E (hr:min:sec): Real time\n%S (sec): Total number of CPU-seconds used by the system on behalf of the process (in kernel mode)\n%U (sec): Total number of CPU-seconds that the process used directly (in user mode)\n%M kB: Max resident set size of the process during its lifetime\n%W: Number of times the process was swapped out of memory\n%P: Percentage of CPU that this job got." {{CMD}}
# Generate flamegraphs
# ex cmd: $ cargo-flamegraph flamegraph download -d dmp -n 1,2,3,14,17,18 -> $ just flmg "download -d dmp -n 1,2,3,14,17,18"
@ -51,5 +57,5 @@ flmg CMD:
cargo-flamegraph flamegraph {{CMD}}
# View perf.data file generated by flamegraph (--no-children flag is useful to sort by each individual stack call instead of by the accumulated callchain of children to parent)