Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(659)

Side by Side Diff: misc/benchcmp

Issue 5727052: code review 5727052: misc: update usage message in benchcmp for go tool (Closed)
Patch Set: diff -r 9dd9374109a9 https://go.googlecode.com/hg/ Created 13 years ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/sh 1 #!/bin/sh
2 # Copyright 2011 The Go Authors. All rights reserved. 2 # Copyright 2011 The Go Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style 3 # Use of this source code is governed by a BSD-style
4 # license that can be found in the LICENSE file. 4 # license that can be found in the LICENSE file.
5 5
6 case "$1" in 6 case "$1" in
7 -*)····· 7 -*)·····
8 echo 'usage: benchcmp old.txt new.txt' >&2 8 echo 'usage: benchcmp old.txt new.txt' >&2
9 echo >&2 9 echo >&2
10 » echo 'Each input file should be gotest -bench output.' >&2 10 » echo 'Each input file should be go test -test.run=NONE -test.bench=. > [ old,new].txt' >&2
11 echo 'Benchcmp compares the first and last for each benchmark.' >&2 11 echo 'Benchcmp compares the first and last for each benchmark.' >&2
12 exit 2 12 exit 2
13 esac 13 esac
14 14
15 awk ' 15 awk '
16 BEGIN { 16 BEGIN {
17 n = 0 17 n = 0
18 } 18 }
19 19
20 $1 ~ /Benchmark/ && $4 == "ns/op" { 20 $1 ~ /Benchmark/ && $4 == "ns/op" {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 continue 57 continue
58 if(anymb++ == 0) 58 if(anymb++ == 0)
59 printf("\n%-*s %12s %12s %7s\n", len, "benchmark", "old MB/s", "new MB/s", "speedup") 59 printf("\n%-*s %12s %12s %7s\n", len, "benchmark", "old MB/s", "new MB/s", "speedup")
60 printf("%-*s %12s %12s %6sx\n", len, what, 60 printf("%-*s %12s %12s %6sx\n", len, what,
61 sprintf("%.2f", oldmb[what]), 61 sprintf("%.2f", oldmb[what]),
62 sprintf("%.2f", newmb[what]), 62 sprintf("%.2f", newmb[what]),
63 sprintf("%.2f", newmb[what]/oldmb[what])) 63 sprintf("%.2f", newmb[what]/oldmb[what]))
64 } 64 }
65 } 65 }
66 ' "$@" 66 ' "$@"
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b