You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
2.4 KiB
61 lines
2.4 KiB
alias b := build
|
|
alias br := build-release
|
|
alias c := check
|
|
alias t := test
|
|
alias tc := test-crate
|
|
alias rc := run-cmd
|
|
|
|
build:
|
|
cargo watch --clear --exec run
|
|
|
|
build-release:
|
|
cargo build --release
|
|
|
|
check:
|
|
cargo watch --clear --exec check
|
|
|
|
test:
|
|
cargo watch --clear --ignore dump --shell "cargo test -- --nocapture"
|
|
|
|
test-crate CRATE:
|
|
RUST_LOG=debug cargo watch --clear --shell "cargo test {{CRATE}} -- --nocapture"
|
|
|
|
run-cmd CMD:
|
|
cargo watch --clear --ignore dump --ignore data --shell "cargo run {{CMD}}"
|
|
|
|
run-cmd-r CMD:
|
|
cargo watch --clear --ignore dump --ignore data --shell "cargo run --release {{CMD}}"
|
|
|
|
# clean up feature branch BRANCH
|
|
done BRANCH:
|
|
git checkout master
|
|
git diff --no-ext-diff --quiet --exit-code
|
|
git pull --rebase origin master
|
|
git diff --no-ext-diff --quiet --exit-code {{BRANCH}}
|
|
git branch -D {{BRANCH}}
|
|
|
|
publish:
|
|
cargo build
|
|
cargo publish
|
|
|
|
|
|
# Profiling
|
|
time 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"
|
|
# ex cmd: $ cargo-flamegraph flamegraph find-bottleneck -d dmp -o . -> $ just flmg "find-bottleneck -d dmp -o ."
|
|
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)
|
|
perf PATH-TO-PERF:
|
|
perf report -i {{PATH-TO-PERF}}
|
|
|