aboutsummaryrefslogtreecommitdiffstats
path: root/benchmark/proto
diff options
context:
space:
mode:
authorChristopher Peplin <chris.peplin@rhubarbtech.com>2013-10-05 16:08:56 -0400
committerChristopher Peplin <chris.peplin@rhubarbtech.com>2014-01-07 13:18:09 -0500
commitc5f3b1fad0552f9f54970bfef25aa56c6795a8df (patch)
treecd576a7b5b0c4b43f367ddcaa2d5ee3bec95cfd2 /benchmark/proto
parent0dbcea457cb624a60ecffe59c163d775ea2fc490 (diff)
Update benchmark tool for latest protobuf format.
Diffstat (limited to 'benchmark/proto')
-rwxr-xr-xbenchmark/proto/compare_sizes.py14
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())