summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2015-04-18 07:03:40 -0700
committerEli Bendersky <eliben@gmail.com>2015-04-18 07:03:40 -0700
commit0874412e612cb327c1452afc8375aed7a18c7531 (patch)
tree9b4759aa38ccb5be81a1b2ebf94af6cdf0dfd7b4
parent00de62cdc817fd1b92dd5d3e38d2a248a1613507 (diff)
downloadpycparser-0874412e612cb327c1452afc8375aed7a18c7531.tar.gz
Update CHANGES
Also add some test code for heapy-based profiling
-rw-r--r--CHANGES1
-rw-r--r--z.py14
2 files changed, 14 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index 9d9d62c..15478f8 100644
--- a/CHANGES
+++ b/CHANGES
@@ -9,6 +9,7 @@
be used instead of ``cpp`` for preprocessing.
- Pull request #64: support keywords like const, volatile, restrict and static
in dimensions in array declarations.
+ - Reduce memory usage of AST nodes (issue #72).
+ Version 2.10 (03.08.2013)
diff --git a/z.py b/z.py
index d881240..33cbf4d 100644
--- a/z.py
+++ b/z.py
@@ -75,6 +75,17 @@ class NodeVisitor(object):
self.current_parent = oldparent
+def heapyprofile():
+ from guppy import hpy
+ import gc
+
+ hp = hpy()
+ ast = parse_file('/tmp/197.c')
+ gc.collect()
+ h = hp.heap()
+ print h
+
+
def memprofile():
import resource
import tracemalloc
@@ -98,7 +109,8 @@ if __name__ == "__main__":
}
'''
- memprofile()
+ #memprofile()
+ heapyprofile()
#parser = CParser()
#ast = parser.parse(source_code, filename='zz')