MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / update_performance_numbers

Function update_performance_numbers

Scripts/UpdateInstructionCountJson.py:13–36  ·  view source on GitHub ↗
(performance_json_path, performance_json, new_json_numbers)

Source from the content-addressed store, hash-verified

11 return dict(items)
12
13def update_performance_numbers(performance_json_path, performance_json, new_json_numbers):
14 for key, items in new_json_numbers.items():
15 if len(key) == 0:
16 continue
17
18 if not key in performance_json["Instructions"]:
19 logging.error("{} didn't exist in performance json file?".format(key))
20 return 1
21
22 if "ExpectedInstructionCount" in items:
23 performance_json["Instructions"][key]["ExpectedInstructionCount"] = items["ExpectedInstructionCount"]
24 if "ExpectedArm64ASM" in items:
25 performance_json["Instructions"][key]["ExpectedArm64ASM"] = items["ExpectedArm64ASM"]
26 if "x86Insts" in performance_json["Instructions"][key]:
27 d = performance_json["Instructions"][key]
28 d.pop('x86InstructionCount', None)
29 d = insert_before(d, "ExpectedInstructionCount",
30 ("x86InstructionCount", len(d["x86Insts"])))
31 performance_json["Instructions"][key] = d
32
33 # Output to the original file.
34 with open(performance_json_path, "w") as json_file:
35 json.dump(performance_json, json_file, indent=2)
36 json_file.write("\n")
37
38def main():
39 if sys.version_info[0] < 3:

Callers 1

mainFunction · 0.85

Calls 4

insert_beforeFunction · 0.85
popMethod · 0.80
dumpMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected