From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: long code blocks making Org Mode very slow Date: Tue, 14 Jul 2015 17:44:54 -0400 Message-ID: <87vbdmv2g9.fsf@alphaville.usersys.redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZF80o-0006cv-96 for emacs-orgmode@gnu.org; Tue, 14 Jul 2015 17:45:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZF80i-00081N-NA for emacs-orgmode@gnu.org; Tue, 14 Jul 2015 17:45:14 -0400 Received: from plane.gmane.org ([80.91.229.3]:47241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZF80i-00080R-Go for emacs-orgmode@gnu.org; Tue, 14 Jul 2015 17:45:08 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZF80h-0004It-G8 for emacs-orgmode@gnu.org; Tue, 14 Jul 2015 23:45:07 +0200 Received: from nat-pool-bos-t.redhat.com ([66.187.233.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 14 Jul 2015 23:45:07 +0200 Received: from ndokos by nat-pool-bos-t.redhat.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 14 Jul 2015 23:45:07 +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 Angus M writes: > 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. See e.g. the thread at http://article.gmane.org/gmane.emacs.orgmode/83704 > 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? > Any help would be appreciated. I am running Org Mode (version 8.2.10) on > Windows 8. > Nick