Fast emacs shell-mode?

2.3k views Asked by At

I am running an interactive program that outputs about 10 MB [edit: probably closer to 100 MB actually] of ASCII text. The performance within emacs shell-mode (Aquamacs) is unacceptably slow, requiring hours to do this. I did execute buffer-disable-undo which speeds things up a bit, but it is still too slow.

I tried running the program with the buffer window hidden, but the program finished and when I reselected the buffer, I still have to wait hours for the output to spool.

Is there some command I can give emacs to make performance acceptable? I don't understand how it is even possible for shell-mode to be this slow: this is a 32 GB multicore machine with 64-bit modern multicore CPUs and SSD.

2

There are 2 answers

8
Barmar On

Set the variables comint-move-point-for-output and comint-scroll-show-maximum-output to nil. This prevents the buffer from continuously scrolling to the end of the output, which requires frequent redisplays.

1
Chris McMahan On

Is your interactive program running within shell mode as a shell script?

Would it be possible to fork the shell process directly to a shell (not shell mode within emacs), then have emacs just load the results on completion?