diff --git a/scripts/wx_check.py b/scripts/wx_check.py old mode 100644 new mode 100755 index 6b781ce8..402a995c --- a/scripts/wx_check.py +++ b/scripts/wx_check.py @@ -15,6 +15,7 @@ import resource import time import sys import urllib2 +import gc from os.path import abspath, dirname import objgraph @@ -34,13 +35,24 @@ uri = 'http://svn.wxwidgets.org/viewvc/wx/wxPython/trunk/src/gtk/_core.py?revisi wx_core = urllib2.urlopen(uri).read() -start = time.time() -print('Process Memory before: %skB' % process_memory()) -# After this the module should be cached. -# Need to invent a path so that it's really cached. -jedi.Script(wx_core, path='foobar.py').completions() -print('Process Memory after: %skB' % process_memory()) +def run(): + start = time.time() + print('Process Memory before: %skB' % process_memory()) + # After this the module should be cached. + # Need to invent a path so that it's really cached. + jedi.Script(wx_core, path='foobar.py').completions() -print(objgraph.most_common_types(limit=50)) -print('\nIt took %s seconds to parse the file.' % (time.time() - start)) + gc.collect() # make sure that it's all fair and the gc did its job. + print('Process Memory after: %skB' % process_memory()) + + print(objgraph.most_common_types(limit=50)) + print('\nIt took %s seconds to parse the file.' % (time.time() - start)) + + +print('First pass') +run() +print('\nSecond pass') +run() +print('\nThird pass') +run()