MCPcopy Create free account
hub / github.com/apache/fory / parse_benchmark_name

Function parse_benchmark_name

benchmarks/cpp/benchmark_report.py:119–141  ·  view source on GitHub ↗

Parse benchmark names like: - BM_Fory_NumericStruct_Serialize - BM_Protobuf_Sample_Deserialize - BM_Msgpack_MediaContent_Deserialize Returns: (library, datatype, operation)

(name)

Source from the content-addressed store, hash-verified

117
118# === Parse benchmark name ===
119def parse_benchmark_name(name):
120 """
121 Parse benchmark names like:
122 - BM_Fory_NumericStruct_Serialize
123 - BM_Protobuf_Sample_Deserialize
124 - BM_Msgpack_MediaContent_Deserialize
125 Returns: (library, datatype, operation)
126 """
127 # Remove BM_ prefix
128 if name.startswith("BM_"):
129 name = name[3:]
130
131 parts = name.split("_")
132 if len(parts) >= 3:
133 library = parts[0].lower()
134 datatype = parts[1].lower()
135 if datatype == "numericstruct":
136 datatype = "struct"
137 elif datatype == "numericstructlist":
138 datatype = "structlist"
139 operation = parts[2].lower()
140 return library, datatype, operation
141 return None, None, None
142
143
144def format_datatype_label(datatype):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected