aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2017-06-07 15:19:24 -0700
committerGravatar ncteisen <ncteisen@gmail.com>2017-06-07 15:19:24 -0700
commit0ac47d28cdc597804e50ac83ae89308aab250f2f (patch)
treea11d6fd80ca3e878adf0588937b177227594fac4 /tools
parent7cd7b7fc433186f6b1f831ca11d015d28b3f7fac (diff)
Github comments
Diffstat (limited to 'tools')
-rwxr-xr-xtools/profiling/microbenchmarks/bm_diff/bm_build.py2
-rw-r--r--tools/profiling/microbenchmarks/bm_diff/bm_constants.py2
-rwxr-xr-xtools/profiling/microbenchmarks/bm_diff/bm_diff.py7
-rwxr-xr-xtools/profiling/microbenchmarks/bm_diff/bm_main.py4
-rwxr-xr-xtools/profiling/microbenchmarks/bm_diff/bm_run.py4
5 files changed, 8 insertions, 11 deletions
diff --git a/tools/profiling/microbenchmarks/bm_diff/bm_build.py b/tools/profiling/microbenchmarks/bm_diff/bm_build.py
index 3d1ccbae30..bc0310fbdd 100755
--- a/tools/profiling/microbenchmarks/bm_diff/bm_build.py
+++ b/tools/profiling/microbenchmarks/bm_diff/bm_build.py
@@ -28,7 +28,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-### Python utility to build opt and counters benchmarks """
+""" Python utility to build opt and counters benchmarks """
import bm_constants
diff --git a/tools/profiling/microbenchmarks/bm_diff/bm_constants.py b/tools/profiling/microbenchmarks/bm_diff/bm_constants.py
index bcefdfb6fe..7d2781ea15 100644
--- a/tools/profiling/microbenchmarks/bm_diff/bm_constants.py
+++ b/tools/profiling/microbenchmarks/bm_diff/bm_constants.py
@@ -28,7 +28,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-### Configurable constants for the bm_*.py family """
+""" Configurable constants for the bm_*.py family """
_AVAILABLE_BENCHMARK_TESTS = [
'bm_fullstack_unary_ping_pong', 'bm_fullstack_streaming_ping_pong',
diff --git a/tools/profiling/microbenchmarks/bm_diff/bm_diff.py b/tools/profiling/microbenchmarks/bm_diff/bm_diff.py
index 72a8d11eea..8279125697 100755
--- a/tools/profiling/microbenchmarks/bm_diff/bm_diff.py
+++ b/tools/profiling/microbenchmarks/bm_diff/bm_diff.py
@@ -48,6 +48,7 @@ verbose = False
def _median(ary):
+ assert(len(ary))
ary = sorted(ary)
n = len(ary)
if n % 2 == 0:
@@ -83,7 +84,7 @@ def _args():
argp.add_argument('-n', '--new', type=str, help='New benchmark name')
argp.add_argument('-o', '--old', type=str, help='Old benchmark name')
argp.add_argument(
- '-v', '--verbose', type=bool, help='print details of before/after')
+ '-v', '--verbose', type=bool, help='Print details of before/after')
args = argp.parse_args()
global verbose
if args.verbose: verbose = True
@@ -210,6 +211,4 @@ if __name__ == '__main__':
args = _args()
diff, note = diff(args.benchmarks, args.loops, args.track, args.old,
args.new)
- print note
- print ""
- print diff if diff else "No performance differences"
+ print('%s\n%s' % (note, diff if diff else "No performance differences"))
diff --git a/tools/profiling/microbenchmarks/bm_diff/bm_main.py b/tools/profiling/microbenchmarks/bm_diff/bm_main.py
index 47381f4ec8..3879848d10 100755
--- a/tools/profiling/microbenchmarks/bm_diff/bm_main.py
+++ b/tools/profiling/microbenchmarks/bm_diff/bm_main.py
@@ -139,9 +139,7 @@ def main(args):
text = 'Performance differences noted:\n' + diff
else:
text = 'No significant performance differences'
- print note
- print ""
- print text
+ print('%s\n%s' % (note, text))
comment_on_pr.comment_on_pr('```\n%s\n\n%s\n```' % (note, text))
diff --git a/tools/profiling/microbenchmarks/bm_diff/bm_run.py b/tools/profiling/microbenchmarks/bm_diff/bm_run.py
index 6ad9f1a3b7..1b3d664d27 100755
--- a/tools/profiling/microbenchmarks/bm_diff/bm_run.py
+++ b/tools/profiling/microbenchmarks/bm_diff/bm_run.py
@@ -28,7 +28,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-### Python utility to run opt and counters benchmarks and save json output """
+""" Python utility to run opt and counters benchmarks and save json output """
import bm_constants
@@ -84,7 +84,7 @@ def _args():
args = argp.parse_args()
assert args.name
if args.loops < 3:
- print "WARNING: This run will likely be noisy. Increase loops."
+ print "WARNING: This run will likely be noisy. Increase loops to at least 3."
return args