From mboxrd@z Thu Jan 1 00:00:00 1970 From: Angus M Subject: Re: long code blocks making Org Mode very slow Date: Tue, 14 Jul 2015 23:39:05 +0000 (UTC) Message-ID: References: <87vbdmv2g9.fsf@alphaville.usersys.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZF9nB-0000Rb-3X for emacs-orgmode@gnu.org; Tue, 14 Jul 2015 19:39:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZF9n7-0000Sw-P6 for emacs-orgmode@gnu.org; Tue, 14 Jul 2015 19:39:17 -0400 Received: from plane.gmane.org ([80.91.229.3]:53225) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZF9n7-0000Sp-Hj for emacs-orgmode@gnu.org; Tue, 14 Jul 2015 19:39:13 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZF9n5-00073B-9v for emacs-orgmode@gnu.org; Wed, 15 Jul 2015 01:39:11 +0200 Received: from 5ac76cdb.bb.sky.com ([5ac76cdb.bb.sky.com]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Jul 2015 01:39:11 +0200 Received: from anguscmelville by 5ac76cdb.bb.sky.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Jul 2015 01:39:11 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Nick Dokos gmail.com> writes: Many thanks for your help Nick - see comments below > > I'm trying to run a long Python code block (~4000 lines) in org mode. The > > code is sandwiched between: > > #+begin_src python > > > > #+end_src > > > > It runs fine, but org mode becomes incredibly slow - when typing text there > > is about a 10 second delay before the character appears on the screen. If I > > reduce the number of lines of code in the block there is a noticeable > > increase in speed. > > > > That's because a) emacs is single-threaded and b) babel blocks are > executed synchronously. emacs waits for the code block to finish > executing before going on with its business. Perhaps I should have been clearer: org mode is incredibly slow to respond (to a key press or to scrolling) even before a block is executed. It is not an issue with waiting for a code block to finish executing. > > I am not using line numbers, and the delay is not ameliorated by turning off > > fontification. > > > > If I add a semi-colon before #+begin_src, to comment it off (get rid of src > > environment), then org mode returns to it's normal speed. > > > > Do I just have to accept that long code blocks can't be entered into Org Mode? > > > > Now I'm confused: are you executing the code block or aren't you? > > IIUC, code blocks can be of arbitrary length: but if you try to run one, you > gotta wait till it finishes. Is that what you are complaining about or > do you see something else? No, I wasn't executing the code block. I just wanted to point out that the org mode slow down was only when the system could see that the long code block was present, i.e. by removing the src environment, by commenting off the #+begin_src marker, the delay disappeared.