aboutsummaryrefslogtreecommitdiffhomepage
path: root/benchmarks/python
diff options
context:
space:
mode:
authorGravatar cclauss <cclauss@bluewin.ch>2018-06-21 00:18:20 +0200
committerGravatar Jie Luo <anandolee@gmail.com>2018-06-20 15:18:20 -0700
commite9063ccf199e9938f7ef563e3683d25375072df3 (patch)
treeee448ce9db61e83fdb64aaa3405a288aa78c2744 /benchmarks/python
parent85ba13c9bfbed5ab97b28fe7284f1267cc5fd9c1 (diff)
print() is a function in Python 3 (#4754)
Diffstat (limited to 'benchmarks/python')
-rwxr-xr-xbenchmarks/python/py_benchmark.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/benchmarks/python/py_benchmark.py b/benchmarks/python/py_benchmark.py
index 6942d208..e86b61e7 100755
--- a/benchmarks/python/py_benchmark.py
+++ b/benchmarks/python/py_benchmark.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
import sys
import os
import timeit
@@ -138,15 +139,15 @@ if __name__ == "__main__":
results.append(run_one_test(file))
if args.json != "no":
- print json.dumps(results)
+ print(json.dumps(results))
else:
for result in results:
- print "Message %s of dataset file %s" % \
- (result["message_name"], result["filename"])
- print "Average time for parse_from_benchmark: %.2f ns" % \
+ print("Message %s of dataset file %s" % \
+ (result["message_name"], result["filename"]))
+ print("Average time for parse_from_benchmark: %.2f ns" % \
(result["benchmarks"][ \
- args.behavior_prefix + "_parse_from_benchmark"])
- print "Average time for serialize_to_benchmark: %.2f ns" % \
+ args.behavior_prefix + "_parse_from_benchmark"]))
+ print("Average time for serialize_to_benchmark: %.2f ns" % \
(result["benchmarks"][ \
- args.behavior_prefix + "_serialize_to_benchmark"])
- print ""
+ args.behavior_prefix + "_serialize_to_benchmark"]))
+ print("")