[pypy-svn] r58849 - pypy/build/benchmem
hpk at codespeak.net
hpk at codespeak.net
Wed Oct 8 19:31:10 CEST 2008
Author: hpk
Date: Wed Oct 8 19:31:09 2008
New Revision: 58849
Modified:
pypy/build/benchmem/report.py
pypy/build/benchmem/runbench.py
pypy/build/benchmem/smaps.py
Log:
report private heap for incremental size
Modified: pypy/build/benchmem/report.py
==============================================================================
--- pypy/build/benchmem/report.py (original)
+++ pypy/build/benchmem/report.py Wed Oct 8 19:31:09 2008
@@ -162,8 +162,8 @@
# checkpoint 0: state before benchmark
# checkpoint 1: state at end of benchmark func
# checkpoint 2: state after benchmark func finished
- basesize = result.snapshots[0].private
- inbench = result.snapshots[1].private
+ basesize = result.snapshots[0].heap_private()
+ inbench = result.snapshots[1].heap_private()
return inbench - basesize
class BaseSizeOfInterpreters:
Modified: pypy/build/benchmem/runbench.py
==============================================================================
--- pypy/build/benchmem/runbench.py (original)
+++ pypy/build/benchmem/runbench.py Wed Oct 8 19:31:09 2008
@@ -182,6 +182,13 @@
self.private = self.private_dirty + self.private_clean
self.shared = self.shared_dirty + self.shared_clean
+ def heap_private(self):
+ private = 0
+ for mapping in self.mappings:
+ if mapping.filename == "[heap]" or not mapping.filename:
+ private += mapping.private_clean + mapping.private_dirty
+ return private
+
def memusage(self):
return "private: %d, shared: %d" %(self.private, self.shared)
Modified: pypy/build/benchmem/smaps.py
==============================================================================
--- pypy/build/benchmem/smaps.py (original)
+++ pypy/build/benchmem/smaps.py Wed Oct 8 19:31:09 2008
@@ -52,6 +52,7 @@
"private_clean private_dirty".split())
# example '402c1000-402c2000 rw-p 00011000 1f:04 1110 /lib/libnsl-2.5.so'
_headattrnames = "virtualaddress mode page dev inode filename".split()
+ filename = ''
def __init__(self, line):
parts = line.split()
More information about the Pypy-commit
mailing list