emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Using buffers instead of string when processing and passing org-babel results
@ 2015-05-22 11:02 Bjarte Johansen
  0 siblings, 0 replies; only message in thread
From: Bjarte Johansen @ 2015-05-22 11:02 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

I have been wondering: Is there a reason org-babel passes around results as strings instead of buffers? I understand there will be more to keep track of and right now there is a great chance of breaking code (org-modes code and other people who depend on the current behaviour).

However, I just did an elementary test with the following

#+BEGIN_SRC bash :results verbatim
  cat file.txt
#+END_SRC

I created the file with the command `base64 /dev/urandom | head -c 100M > file.txt`.

If I execute the script in the normal way it takes more then half a minute to complete. If I on the other hand convert every point on the path that expect it to be a string to be a buffer instead it takes less than 5 seconds to complete the script and insert the result into the buffer.

I understand that it might not be normal to insert these big files into the org-buffer, but the problem is also there if you want to silence the result and pass it from script to script. The creation of big strings is really slow.

I also feel that buffers are more natural vessels for the results. They are easier to manipulate than strings in Emacs and are much much faster. A big problem however is how do we handle the buffers that are created? They won’t be garage collected, so we need a way to safely kill them when we no longer need them.

Is this something that org-mode is interested in? I could try to work on it, but if org-mode isn’t interested in the change I am not sure I will bother.

Regards,
Bjarte

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-22 11:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-22 11:02 Using buffers instead of string when processing and passing org-babel results Bjarte Johansen

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).