diff options
| author | Rémi Verschelde | 2016-09-01 22:10:20 +0200 |
|---|---|---|
| committer | Rémi Verschelde | 2016-09-05 07:49:22 +0200 |
| commit | ae9729b6df885eb04c63501b33399d401829a76a (patch) | |
| tree | 9aeccaf18bd852a516ea137f2347f9a634993d34 /tools/scripts/memsort.py | |
| parent | 08e5e8794aceff8de4a928d1876c6af88601a5db (diff) | |
| download | godot-ae9729b6df885eb04c63501b33399d401829a76a.tar.gz godot-ae9729b6df885eb04c63501b33399d401829a76a.tar.zst godot-ae9729b6df885eb04c63501b33399d401829a76a.zip | |
Diffstat (limited to 'tools/scripts/memsort.py')
| -rw-r--r-- | tools/scripts/memsort.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tools/scripts/memsort.py b/tools/scripts/memsort.py new file mode 100644 index 000000000..d2e4fe022 --- /dev/null +++ b/tools/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])) |
