Skip to content

Instantly share code, notes, and snippets.

@rondreas
Created April 1, 2021 07:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rondreas/a626227a12a80d70169833d1ccd32d5a to your computer and use it in GitHub Desktop.
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.
"""
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