mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
multiple passes for wx script
This commit is contained in:
12
scripts/wx_check.py
Normal file → Executable file
12
scripts/wx_check.py
Normal file → Executable file
@@ -15,6 +15,7 @@ import resource
|
|||||||
import time
|
import time
|
||||||
import sys
|
import sys
|
||||||
import urllib2
|
import urllib2
|
||||||
|
import gc
|
||||||
from os.path import abspath, dirname
|
from os.path import abspath, dirname
|
||||||
|
|
||||||
import objgraph
|
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()
|
wx_core = urllib2.urlopen(uri).read()
|
||||||
|
|
||||||
|
|
||||||
|
def run():
|
||||||
start = time.time()
|
start = time.time()
|
||||||
print('Process Memory before: %skB' % process_memory())
|
print('Process Memory before: %skB' % process_memory())
|
||||||
# After this the module should be cached.
|
# After this the module should be cached.
|
||||||
# Need to invent a path so that it's really cached.
|
# Need to invent a path so that it's really cached.
|
||||||
jedi.Script(wx_core, path='foobar.py').completions()
|
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('Process Memory after: %skB' % process_memory())
|
||||||
|
|
||||||
print(objgraph.most_common_types(limit=50))
|
print(objgraph.most_common_types(limit=50))
|
||||||
print('\nIt took %s seconds to parse the file.' % (time.time() - start))
|
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