diff options
author | Christopher Peplin <chris.peplin@rhubarbtech.com> | 2013-10-05 16:08:56 -0400 |
---|---|---|
committer | Christopher Peplin <chris.peplin@rhubarbtech.com> | 2014-01-07 13:18:09 -0500 |
commit | c5f3b1fad0552f9f54970bfef25aa56c6795a8df (patch) | |
tree | cd576a7b5b0c4b43f367ddcaa2d5ee3bec95cfd2 /benchmark | |
parent | 0dbcea457cb624a60ecffe59c163d775ea2fc490 (diff) |
Update benchmark tool for latest protobuf format.
Diffstat (limited to 'benchmark')
-rwxr-xr-x | benchmark/proto/compare_sizes.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/benchmark/proto/compare_sizes.py b/benchmark/proto/compare_sizes.py index 192716f4..5eee74cf 100755 --- a/benchmark/proto/compare_sizes.py +++ b/benchmark/proto/compare_sizes.py @@ -40,18 +40,14 @@ for trace_file in sys.argv[1:]: message.raw_message = binary_message total_raw_binary_size += len(message.SerializeToString()) else: + message.type = openxc_pb2.VehicleMessage.TRANSLATED + message.translated_message.name = json_message['name'] if isinstance(json_message['value'], bool): - message.type = openxc_pb2.VehicleMessage.BOOL - message.boolean_message.name = json_message['name'] - message.boolean_message.value = json_message['value'] + message.translated_message.boolean_value = json_message['value'] elif isinstance(json_message['value'], numbers.Number): - message.type = openxc_pb2.VehicleMessage.NUM - message.numerical_message.name = json_message['name'] - message.numerical_message.value = json_message['value'] + message.translated_message.numerical_value = json_message['value'] else: - message.type = openxc_pb2.VehicleMessage.STRING - message.string_message.name = json_message['name'] - message.string_message.value = json_message['value'] + message.translated_message.string_value = json_message['value'] total_translated_json_size += len(line) total_translated_binary_size += len(message.SerializeToString()) |