|
|
@ -1,5 +1,6 @@ |
|
|
|
# This import depends on the automake rule protoc_middleman, please make sure |
|
|
|
# This import depends on the automake rule protoc_middleman, please make sure |
|
|
|
# protoc_middleman has been built before run this file. |
|
|
|
# protoc_middleman has been built before run this file. |
|
|
|
|
|
|
|
import argparse |
|
|
|
import json |
|
|
|
import json |
|
|
|
import re |
|
|
|
import re |
|
|
|
import os.path |
|
|
|
import os.path |
|
|
@ -298,3 +299,39 @@ def get_result_from_file(cpp_file="", |
|
|
|
__parse_php_result(php_c_file, "php") |
|
|
|
__parse_php_result(php_c_file, "php") |
|
|
|
|
|
|
|
|
|
|
|
return __results |
|
|
|
return __results |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
|
|
|
|
|
parser = argparse.ArgumentParser() |
|
|
|
|
|
|
|
parser.add_argument("-cpp", "--cpp_input_file", |
|
|
|
|
|
|
|
help="The CPP benchmark result file's name", |
|
|
|
|
|
|
|
default="") |
|
|
|
|
|
|
|
parser.add_argument("-java", "--java_input_file", |
|
|
|
|
|
|
|
help="The Java benchmark result file's name", |
|
|
|
|
|
|
|
default="") |
|
|
|
|
|
|
|
parser.add_argument("-python", "--python_input_file", |
|
|
|
|
|
|
|
help="The Python benchmark result file's name", |
|
|
|
|
|
|
|
default="") |
|
|
|
|
|
|
|
parser.add_argument("-go", "--go_input_file", |
|
|
|
|
|
|
|
help="The golang benchmark result file's name", |
|
|
|
|
|
|
|
default="") |
|
|
|
|
|
|
|
parser.add_argument("-node", "--node_input_file", |
|
|
|
|
|
|
|
help="The node.js benchmark result file's name", |
|
|
|
|
|
|
|
default="") |
|
|
|
|
|
|
|
parser.add_argument("-php", "--php_input_file", |
|
|
|
|
|
|
|
help="The pure php benchmark result file's name", |
|
|
|
|
|
|
|
default="") |
|
|
|
|
|
|
|
parser.add_argument("-php_c", "--php_c_input_file", |
|
|
|
|
|
|
|
help="The php with c ext benchmark result file's name", |
|
|
|
|
|
|
|
default="") |
|
|
|
|
|
|
|
args = parser.parse_args() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
results = get_result_from_file( |
|
|
|
|
|
|
|
cpp_file=args.cpp_input_file, |
|
|
|
|
|
|
|
java_file=args.java_input_file, |
|
|
|
|
|
|
|
python_file=args.python_input_file, |
|
|
|
|
|
|
|
go_file=args.go_input_file, |
|
|
|
|
|
|
|
node_file=args.node_input_file, |
|
|
|
|
|
|
|
php_file=args.php_input_file, |
|
|
|
|
|
|
|
php_c_file=args.php_c_input_file, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
print(json.dumps(results, indent=2)) |
|
|
|