Subject: bug#21077: 24.5; Slow printing in inferior python buffer with python-shell-enable-font-lock

From: Ista Zahn <[email-masked]>
Date: Sat, 1 Aug 2015 12:26:28 -0400

On Sat, Aug 1, 2015 at 8:36 AM, Wolfgang Jenkner <[email-masked]> wrote:
> On Fri, Jul 31 2015, Ista Zahn wrote:
>
>> 1. Start emacs with 'emacs -Q'
>> 2. Type 'M-x ielm' then '(number-sequence 1 9999)'
>> 3. Type 'M-x eshell' then 'number-sequence 1 9999 RET'
>> 4. Type 'M-x shell' then 'python -c "print(list(range(9999)))" RET'
>> 5. Type 'M-x run-python' then 'print(list(range(9999))) RET'
>>
>> For me 1-3 print relatively quickly, 4 prints relatively slowly, and
>> _only_ 5 is so slow that I consider it non-functional. This bug report
>> is about issue 5 above.
>
> I tested this with the current (bdd370b) vanilla emacs -Q master and
> also a slightly older (78c3e14, not quite vanilla) version and I find
> that 5 takes about 20 seconds while 4 takes about 30 seconds to print
> the whole list (and the next prompt).  So, the reason for the behaviour
> you reported (and Eli confirmed) might be elsewhere than in
> font-locking?

This bug report is against emacs 24.5; I think you'll find very
different results there.

Nevertheless it is good to know that things are improved in recent
development versions; I have confirmed that this is true on my system
as well. So at least we can look forward to this being fixed in the
25.0 release. I'm not sure when that is expected, but unless it is
expected to be released soon I think it would be a good idea to
backport a fix to 24.5.

Best,

>
> I compiled emacs with
>
> ./configure --prefix=/usr/opt --with-x --with-x-toolkit=no --without-rsvg --without-cairo --without-gsettings --with-file-notification=no --without-compress-install
>
> and the beginning of the python buffer is
>
> Python 2.7.10 (default, Jul  4 2015, 12:57:42)
> [GCC 4.2.1 Compatible FreeBSD Clang 3.4.1 (tags/RELEASE_34/dot1-final 208032)] on freebsd10
> Type "help", "copyright", "credits" or "license" for more information.
>>>> python.el: readline is available
>>>> python.el: sent setup code
>>>> print(list(range(9999)))
>
> I've also a ~/.pythonrc.py which contains
>
> import rlcompleter, readline
> readline.parse_and_bind('tab: complete')