From: Eric L. <Eri...@ma...> - 2011-06-14 14:55:24
|
Hi, There were some bugs I fixed a while back relating to highlighting error messages so they are clickable, and can go to the source of the error. That could be the issue, since that code will look backwards to fixup boken error messages. Error text is broken if ½ comes out on the command line in one chunk, followed by another chunk later. When the second chunk comes out, you need to look back for the beginning of the chunk. Since you already directly know it is size related, you could set comint-buffer-maximum-size in your matlab-shell-mode-hook for a quick fix. In matlab-shell functions, I see 1 occurrence of re-search-backward with no bounds. (The second argument.) One is in matlab-shell-render-html-anchor. I'll guess it needs something similar to what is in matlab-shell-render-errors-as-anchor with that reverse search. It may be that the error and html highlighters should share a single variable to mark the last location of an error. Anyway, as a quick hack, line 4522 (in the CVS version of matlab.el in the function matlab-shell-render-anchor) could be (when (re-search-backward matlab-anchor-beg (max 0 (- (point-max) 5000) t) just to put some random limit for performance testing. If that helps, we'll know what the issue is and can fix it more robustly. Eric From: Ondra Kamenik [mailto:ond...@gm...] Sent: Tuesday, June 14, 2011 10:02 AM To: mat...@li... Subject: [Matlab-emacs-discuss] matlab-shell slows down when buffer is large Eric and others, I have been a happy user of matlab-shell for years. Thanks Eric. However, recently (I cannot recollect exactly when, one year ago?), I experience slowing down of matlab-shell. We run complex matlab programs which call various external programs. The output displayed in matlab-shell consists of messages of various format from matlab, latex, svn, rational expectations solvers, etc. It seems that if there is a lot of output in the matlab-shell buffer, emacs becomes unresponsive, or very slow. Looking at top output, emacs seems to take much of processor time doing effectively nothing. The situation seems to be worse, if there are some matlab errors in the output. It seems to me that emacs does some processing of the whole buffer each time something happens on the command line. When the buffer gets large (say 20000 lines), emacs seems very busy (by processing the whole buffer?) and the interactive work becomes a real pain. If one executes the code in M-file using C-c r, it takes ages before the code is copied to the buffer and one can actually observe how the code is being added character by c-h-a-r-a-c-t-e-r. If you tell me how I can debug it, I will be happy to replicate the behaviour and send you a further information. I use matlab 2009b, various computers with fedora 12 through 14, emacs version 23.2.1 or 23.1.1, matlab-shell version 3.3.1 or 3.3.0. My colleague has the same problem on some ubuntu with newer matlab. On my fedora 12, emacs 23.1.1 and matlab shell 3.3.1 laptop, I do not experience the problem. On my desktop with the same versions I have the problem. The only difference I am aware of is that the laptop is 64, desktop is 32. But my other desktop is 64 and I have the error there. I will be happy to provide you with more information if I know what. Thanks! Ondra K. |