Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
read a file with render thread data as csv from pix and print out function names and times function was called.
"""
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