[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] Using buffers instead of string when processing and passing org-babe
From: |
Bjarte Johansen |
Subject: |
[O] Using buffers instead of string when processing and passing org-babel results |
Date: |
Fri, 22 May 2015 13:02:51 +0200 |
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [O] Using buffers instead of string when processing and passing org-babel results,
Bjarte Johansen <=