Message312877
from idlelib.pyparse import Parser
import timeit
code='def f():\n'
print(timeit.timeit("statement", # for example
"p=Parser(4,4)", globals = globals()))
statement microseconds
Parser .1 # test timeit code
Parser() 2.2
p.set_code('') 1.4
p.set_code(code) 1.8
'('.translate(map1) 1.5 or 2.2 depending on ParseMap
Translate time is longer for real code and Parser() instance creation time must be well less than 1/10, maybe 1/100 of any answer time. If we don't reuse instances, though, set_code should be part of __init__ (and tests changed). Either change is low priority. |
|
Date |
User |
Action |
Args |
2018-02-26 05:44:51 | terry.reedy | set | recipients:
+ terry.reedy, serhiy.storchaka, cheryl.sabella |
2018-02-26 05:44:51 | terry.reedy | set | messageid: <1519623891.4.0.467229070634.issue32880@psf.upfronthosting.co.za> |
2018-02-26 05:44:51 | terry.reedy | link | issue32880 messages |
2018-02-26 05:44:50 | terry.reedy | create | |
|