Created
April 1, 2021 07:40
-
-
Save rondreas/a626227a12a80d70169833d1ccd32d5a to your computer and use it in GitHub Desktop.
read a file with render thread data as csv from pix and print out function names and times function was called.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Given a flat list copy pasted as csv from PIX Timing capture, list unique names | |
""" | |
def main(): | |
names = list() | |
with open("renderthread_dump.csv", 'r') as f: | |
lines = f.readlines() | |
for line in lines[2:]: # first line is a header, second contained information about full frame render time. | |
names.append(line.split('\t')[0]) | |
unique_names = set(names) | |
result = dict() | |
for name in unique_names: | |
if not name.strip(): | |
continue # ignore empty strings, last line was empty due to bad copy pasta | |
result[name] = names.count(name) | |
for name in sorted(result, key=result.get): | |
print("{}: {}".format(name, result[name])) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment