Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slow Mac when sending input to an inferior python process

Update: This does not hold for R's inferior ESS process on Mac, but of course I'm here interested in Python.

More updates: It just seems the buffer is slow for evaluating newlines.

Whenever I evaluate (send text) to the inferior buffer, it is extremely slow to send and render the text in the inferior buffer. You can literally see it write the ... for each single line. So imagine having a 100 line function, that would take a while (note: the actual execution of the function is no problem, just the writing lines to the buffer is).

What would be the variable to change for this?

Try:

def uselessfunction():
    a = 1
    a = 1
    a = 1
    a = 1
    a = 1
    a = 1
    a = 1

In the output buffer it then prints:

>>> >>> >>> ... ... ... ... ... ... ... ... >>> 

which appears really slowly.

Another example, using:

(process-send-string PROCESS "\n\n\n\n")

is also slow, as well as (comint-send-input) after some lines are written in the inferior python shell.

It seems mostly enters are slowing this down.

Note that all of this is not the case in Ubuntu.

like image 817
PascalVKooten Avatar asked Oct 03 '14 16:10

PascalVKooten


1 Answers

In the end, I'm now avoiding the problem by using IPython instead of Python 2.7. It has the %paste magic command that helps me solve the issue.

like image 61
PascalVKooten Avatar answered Oct 05 '22 22:10

PascalVKooten