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 myungsekyo
Recipients myungsekyo
Date 2019-07-01.09:35:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1561973733.3.0.964071328037.issue37466@roundup.psfhosted.org>
In-reply-to
Content
I think it is more efficient to cast `variable prompt` into string after its validation in _raw_input().
Because If it is None or empty string then it is not used. 

```
import timeit

MAX = 10000000


start = timeit.default_timer()
for i in range(MAX):
    _raw_input()

end = timeit.default_timer()

print('estimated : {}'.format(end - start))

```
I tested on 10 millions inputs with above code.
and the result is as follows.

Before:
    estimated : 5.060587857999053
    estimated : 5.0425375679988065
    estimated : 4.850400277999142
    estimated : 4.888060468998447
    estimated : 4.849542597999971
    estimated : 4.822679259999859
    estimated : 5.053791769001691
    estimated : 4.914149145999545
    estimated : 4.9584080040003755
    estimated : 4.944711199001176

After:
    estimated : 4.014042392998817
    estimated : 3.987057284997718
    estimated : 4.081281360999128
    estimated : 4.06813505899845
    estimated : 4.040622504999192
    estimated : 4.1239150339970365
    estimated : 4.174400065003283
    estimated : 4.015272281998477
    estimated : 4.034917910001241
    estimated : 4.08582956799728
History
Date User Action Args
2019-07-01 09:35:33myungsekyosetrecipients: + myungsekyo
2019-07-01 09:35:33myungsekyosetmessageid: <1561973733.3.0.964071328037.issue37466@roundup.psfhosted.org>
2019-07-01 09:35:33myungsekyolinkissue37466 messages
2019-07-01 09:35:32myungsekyocreate