Commits

ZyX_I committed 126809d

Added profiling script

Comments (0)

Files changed (1)

+#!/bin/zsh
+: ${TEMPDIR:=/tmp/frawor-profile}
+typeset -xr TEMPDIR
+test -d $TEMPDIR || mkdir -p $TEMPDIR
+local -r REV=${1:-.}
+(( $# )) && shift
+if [[ $REV == '.' ]] ; then
+    hg locate -0 | xargs -0 tar c -C $(hg root) | (cd $TEMPDIR && tar x)
+else
+    hg archive -r $REV $TEMPDIR
+fi
+pushd $TEMPDIR
+vim -u <(<<< 'set nocompatible rtp=$TEMPDIR') -U NONE \
+    --startuptime starttime.dat \
+    --cmd 'profile start profile.dat' \
+    --cmd 'profile func *' \
+    --cmd 'profile file *' \
+    $@ \
+    -c 'profile pause' \
+    -c 'qa!'
+popd
+cp $TEMPDIR/profile.dat .
+cp $TEMPDIR/starttime.dat .