summaryrefslogtreecommitdiffstats
path: root/misc/scripts/memsort.py
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-02-09 00:07:44 +0100
committerRémi Verschelde <rverschelde@gmail.com>2017-02-09 00:08:27 +0100
commitb87a232668d9f9f3b32c2fceb60bc5f6ef46df22 (patch)
tree40bf3a8b94fbca24f9bf144e4ac9eee7f3c011d0 /misc/scripts/memsort.py
parentb19c9bd1983b8c72621595b7c22daade4ebf6625 (diff)
downloadredot-engine-b87a232668d9f9f3b32c2fceb60bc5f6ef46df22.tar.gz
Reorder the folders in tools to prepare moving tools/editor
- `certs` and `editor_fonts` go to `thirdparty` - `dist` and `scripts` go to a new `misc` folder - `collada` and `doc` go to `tools/editor` The next step will be to rename `tools/editor` to `editor` directly, but this will be done at the right time to avoid breaking too many PRs.
Diffstat (limited to 'misc/scripts/memsort.py')
-rw-r--r--misc/scripts/memsort.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/misc/scripts/memsort.py b/misc/scripts/memsort.py
new file mode 100644
index 0000000000..fb636b0f78
--- /dev/null
+++ b/misc/scripts/memsort.py
@@ -0,0 +1,35 @@
+
+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]))