This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients cheryl.sabella, serhiy.storchaka, terry.reedy
Date 2018-02-26.05:44:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1519623891.4.0.467229070634.issue32880@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-02-26 05:44:51terry.reedysetrecipients: + terry.reedy, serhiy.storchaka, cheryl.sabella
2018-02-26 05:44:51terry.reedysetmessageid: <1519623891.4.0.467229070634.issue32880@psf.upfronthosting.co.za>
2018-02-26 05:44:51terry.reedylinkissue32880 messages
2018-02-26 05:44:50terry.reedycreate