aboutsummaryrefslogtreecommitdiff
path: root/tools/memsort.py
diff options
context:
space:
mode:
authorJuan Linietsky2014-02-09 22:10:30 -0300
committerJuan Linietsky2014-02-09 22:10:30 -0300
commit0b806ee0fc9097fa7bda7ac0109191c9c5e0a1ac (patch)
tree276c4d099e178eb67fbd14f61d77b05e3808e9e3 /tools/memsort.py
parent0e49da1687bc8192ed210947da52c9e5c5f301bb (diff)
downloadgodot-0b806ee.tar.gz
godot-0b806ee.tar.zst
godot-0b806ee.zip
GODOT IS OPEN SOURCE
Diffstat (limited to 'tools/memsort.py')
-rw-r--r--tools/memsort.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/tools/memsort.py b/tools/memsort.py
new file mode 100644
index 000000000..8ecccae8b
--- /dev/null
+++ b/tools/memsort.py
@@ -0,0 +1,36 @@
+
+import sys
+
+arg="memdump.txt"
+
+if (len(sys.argv)>1):
+ arg=sys.argv[1]
+
+f = open(arg,"rb")
+
+
+l=f.readline()
+
+
+sum = {}
+cnt={}
+
+
+while(l!=""):
+
+ s=l.split("-")
+ amount = int(s[1])
+ what=s[2]
+ if (what in sum):
+ sum[what]+=amount
+ cnt[what]+=1
+ else:
+ sum[what]=amount
+ cnt[what]=1
+
+ l=f.readline()
+
+
+for x in sum:
+ print(x.strip()+"("+str(cnt[x])+"):\n: "+str(sum[x]))
+ \ No newline at end of file