multiple passes for wx script

This commit is contained in:
Dave Halter
2014-02-13 17:47:52 +01:00
parent 5be996baa8
commit 660a29ef93

12
scripts/wx_check.py Normal file → Executable file
View File

@@ -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()
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()
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()