mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
multiple passes for wx script
This commit is contained in:
28
scripts/wx_check.py
Normal file → Executable file
28
scripts/wx_check.py
Normal file → Executable 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()
|
||||
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user