diff options
author | paulgazz@chromium.org <paulgazz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-14 19:36:08 +0000 |
---|---|---|
committer | paulgazz@chromium.org <paulgazz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-14 19:36:08 +0000 |
commit | 80092a3286ea06759d0cd7a2b040ae2f19a50e55 (patch) | |
tree | 7026fdcbd9415007843c3e2a9a15382022f905c2 /courgette/analyze_stress_test | |
parent | 1819dc9a76cc6a6e559b6c900b2fa7e34f9dc430 (diff) | |
download | chromium_src-80092a3286ea06759d0cd7a2b040ae2f19a50e55.zip chromium_src-80092a3286ea06759d0cd7a2b040ae2f19a50e55.tar.gz chromium_src-80092a3286ea06759d0cd7a2b040ae2f19a50e55.tar.bz2 |
Added time and memory metrics and xz compression tests
BUG=266021,205187,266028
Review URL: https://chromiumcodereview.appspot.com/22313007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217611 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'courgette/analyze_stress_test')
-rwxr-xr-x | courgette/analyze_stress_test | 66 |
1 files changed, 58 insertions, 8 deletions
diff --git a/courgette/analyze_stress_test b/courgette/analyze_stress_test index 6aff656..338eb6e 100755 --- a/courgette/analyze_stress_test +++ b/courgette/analyze_stress_test @@ -22,6 +22,24 @@ count_result() { fi } +# Given a token, search for and compute the percentiles from logfile. +compute_percentiles() { + if [ ! -z "${1}" ]; then + local pctls=".5 .9 1" + local lines=$(count_result ${1}) + for p in $pctls; do + local count="$(echo "${lines} * $p" | bc -lq | cut -d. -f1)" + echo -n $(cat ${log} \ + | grep ${1} \ + | cut -d' ' -f2 \ + | sort -n \ + | head -n$count \ + | tail -n1) + echo -n "s " + done + fi +} + main() { if [ $# -lt 1 ]; then cat <<EOF @@ -46,9 +64,12 @@ $(count_result "FAIL_COURGETTE") failed courgette patches $(count_result "FAIL_DISASSEMBLE") failed to disassemble/assemble $(count_result "PASS_BSDIFF") succesful bsdiff patches $(count_result "FAIL_BSDIFF") failed bsdiff patches -$(count_result "BEST_COURGETTE") patch(es) where courgette is smaller -$(count_result "BEST_BSDIFF") patch(es) where bsdiff is smaller -$(count_result "BEST_TIE") patch(es) where both are the same size +$(count_result "BEST_COURGETTE") patch(es) where courgette is smaller (bz2) +$(count_result "BEST_BSDIFF") patch(es) where bsdiff is smaller (xz) +$(count_result "BEST_TIE") patch(es) where both are the same size (bz2) +$(count_result "XZBEST_COURGETTE") patch(es) where courgette (xz) is smaller +$(count_result "XZBEST_BSDIFF") patch(es) where bsdiff is smaller (xz) +$(count_result "XZBEST_TIE") patch(es) where both are the same size (xz) EOF # Log file has the format "^SIZE courgette=... bsdiff=..." @@ -56,7 +77,13 @@ EOF | grep "^SIZE " \ | cut -d' ' -f2 \ | awk -F= 'BEGIN{sum=0} {sum += $2} END{print sum}')" - echo "${courgette_total} bytes for a courgette payload" + echo "${courgette_total} bytes for a courgette payload (bz2)" + + local courgette_total_xz="$(cat "${log}" \ + | grep "^SIZE " \ + | cut -d' ' -f4 \ + | awk -F= 'BEGIN{sum=0} {sum += $2} END{print sum}')" + echo "${courgette_total_xz} bytes for a courgette payload (xz)" local bsdiff_total="$(cat "${log}" \ | grep "^SIZE " \ @@ -67,20 +94,43 @@ EOF local best_total="$(cat "${log}" \ | grep "^BEST_" \ | awk 'BEGIN{sum=0} {sum += $2} END{print sum}')" - echo "${best_total} bytes for a best-choice payload" + echo "${best_total} bytes for a best-choice payload (bz2)" + + local best_total_xz="$(cat "${log}" \ + | grep "^XZBEST_" \ + | awk 'BEGIN{sum=0} {sum += $2} END{print sum}')" + echo "${best_total_xz} bytes for a best-choice payload (xz)" local pct="$(echo "100*${best_total}/${bsdiff_total}" \ | bc -lq \ | awk '{printf "%.2f\n", $0}')" - echo "${pct}% of a bsdiff-only payload" + echo "${pct}% of a bsdiff-only payload (bz2)" + + local pct="$(echo "100*${best_total_xz}/${bsdiff_total}" \ + | bc -lq \ + | awk '{printf "%.2f\n", $0}')" + echo "${pct}% of a bsdiff-only payload (xz)" local savings="$((bsdiff_total - best_total))" - echo "${savings} bytes saved by courgette" + echo "${savings} bytes saved by courgette (bz2)" + + local savings_xz="$((bsdiff_total - best_total_xz))" + echo "${savings} bytes saved by courgette (xz)" local pct_savings="$(echo "100*${savings}/${bsdiff_total}" \ | bc -lq \ | awk '{printf "%.2f\n", $0}')" - echo "${pct_savings}% savings" + echo "${pct_savings}% savings (bz2)" + + local pct_savings="$(echo "100*${savings_xz}/${bsdiff_total}" \ + | bc -lq \ + | awk '{printf "%.2f\n", $0}')" + echo "${pct_savings}% savings (xz)" + + echo "$(compute_percentiles "TIME_GEN")to generate a patch (50th 90th 100th)" + echo "$(compute_percentiles "TIME_APPLY")to apply a patch (50th 90th 100th)" + echo "$(compute_percentiles "TIME_BSDIFF")for bsdiff (50th 90th 100th)" + echo "$(compute_percentiles "TIME_BSPATCH")for bspatch (50th 90th 100th)" } main "${@}" |