Message185986
| Author |
roger.serwy |
| Recipients |
ajaksu2, drhok, gpolo, josiahcarlson, kbk, rhettinger, roger.serwy, taleinat, terry.reedy |
| Date |
2013年04月04日.00:47:43 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1365036464.04.0.243713358333.issue1442493@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
The only reason that the IDLE shell is slow is due to the shell's text widget being configured to have wrap="char". If we manually wrapped the output then the shell responds very quickly to rendering really long strings.
The attached proof-of-concept patch (against 2.7 tip) implements manual wrapping. You can type "print('a' * 10**6)" and the shell responds almost instantly when using no-subprocess mode. (The RPC overhead becomes readily apparent when using a subprocess, introducing a large uninteruptable delay. That's another issue.)
I left text wrapping enabled in the shell since the user may be using a variable-spaced font. A possible compromise would be to increase the wrap_index to a large number, like 32768, before IDLE inserts a '\n' into the output. This would mimic the wrapping behavior of the original shell, but keep the shell responsive when you write a very long string to the output. |
|