emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Angus M <anguscmelville@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: long code blocks making Org Mode very slow
Date: Tue, 14 Jul 2015 23:39:05 +0000 (UTC)	[thread overview]
Message-ID: <loom.20150715T012706-598@post.gmane.org> (raw)
In-Reply-To: 87vbdmv2g9.fsf@alphaville.usersys.redhat.com

Nick Dokos <ndokos <at> 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
> > <python code block>
> > #+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.

  reply	other threads:[~2015-07-14 23:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-14 18:15 long code blocks making Org Mode very slow Angus M
2015-07-14 19:41 ` Sebastien Vauban
2015-07-14 21:06   ` Angus M
2015-07-14 21:44 ` Nick Dokos
2015-07-14 23:39   ` Angus M [this message]
2015-07-15 12:22 ` Angus M
2015-07-17  1:10   ` Grant Rettke
2015-07-21 11:09     ` Angus M
2015-07-22  1:20       ` Grant Rettke
2015-07-22 10:09         ` Angus M
2015-07-22 12:41           ` Nick Dokos
2015-07-22 23:09             ` Grant Rettke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20150715T012706-598@post.gmane.org \
    --to=anguscmelville@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).