So I've been searching around for this particular problem and apparently I found no solutions.

There are posts on reddit about this: https://www.reddit.com/r/emacs/comments/3scsak/incredibly_slow_comint_eg_shell_compile_output_on/.

But still no solution. The problem is simple: emacs shell is really bad when you run codes that display lots of text in the shell.

I run fluids simulations and the difference between running the code via emacs' shell and VS code's shell is like day and night. This is what I get running the same test case (1D so not very intensive)

  • VS code embedded shell: 10 seconds.
  • Emacs shell: more than 1 minute and still running....

Anyone experiences issue when compiling, running code that outputs lots of text? I need to see the outputs as the code runs.

  • Have you tried using M-x compile or evaluating (compile COMMAND-LINE); and, does that resolve your speed issues when compiling? Of course, it is not a shell, but may be a viable alternative -- it is especially useful when it comes to jumping to the relevant section of the source code from the compilation buffer. – lawlist Aug 20 '19 at 3:11
  • Using M-x compile is just as slow. – mle0312 Aug 20 '19 at 3:21
  • What's VS? How big is "lots of text"? – JeanPierre Aug 20 '19 at 12:12
  • VS code: visual studio code, another text editor. The terminal that I run in this application to run my code is faster than the shell/terminal in emacs. "Lots of text" in my scenario is around 10 lines per screen, and those 10 lines will keep updating as the code runs – mle0312 Aug 20 '19 at 15:12
  • sounds like your output is getting buffered. you'll need to modify your program to ensure its output is unbuffered. also for shell, eshell, term, and ansi-term and see how they deal with buffered/unbuffered text. – nega Aug 20 '19 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.