From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?J=C3=A9r=C3=A9my_Compostella?= Subject: [PATCH] org-babel-exp-lob-one-liners should not parse the entire buffer. Date: Thu, 24 Nov 2011 16:56:11 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:49020) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTbfM-0007lM-VK for emacs-orgmode@gnu.org; Thu, 24 Nov 2011 10:56:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTbfI-0007JQ-KA for emacs-orgmode@gnu.org; Thu, 24 Nov 2011 10:56:48 -0500 Received: from mail-fx0-f41.google.com ([209.85.161.41]:36681) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTbfI-0007JB-9C for emacs-orgmode@gnu.org; Thu, 24 Nov 2011 10:56:44 -0500 Received: by faas10 with SMTP id s10so3666909faa.0 for ; Thu, 24 Nov 2011 07:56:43 -0800 (PST) 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 --=-=-= All, I'm currently generating a road book for a trip from different Org-Mode file and other data. It results in a 13 thousands lines Org-Mode file and I have some performance issues. Using the ELP package, I isolated the two main bottlenecks. 1. One is in org-odt : the org-odt-write-manifest-file function is called once and takes 5.546672 seconds to write a 167 lines file. I rewrote this function and now it takes 0.01606 seconds to write the same file. As usually for this package, I directly send the patch to the org-odt author. 2. The other is in ob-exp : the org-babel-exp-lob-one-liners parse to the end of the buffer instead of the region given as arguments. On my "big" file it results in 50 seconds execution of the org-babel-exp-lob-one-liners function. With the patch it only takes 0.871 seconds. Please merge it or review it. Regards, Jeremy -- Sent from my Emacs --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-org-babel-exp-lob-one-liners-should-not-parse-the-en.patch Content-Description: patch: org-babel-exp-lob-one-liners should not parse the entire buffer >From 86bd70539203443679fd55788db2a598529135d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Compostella?= Date: Thu, 24 Nov 2011 16:20:00 +0100 Subject: [PATCH] org-babel-exp-lob-one-liners should not parse the entire buffer. The org-babel-exp-lob-one-liners search "call" pattern through the entire buffer instead of the region given as arguments. --- lisp/ob-exp.el | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el index f2e20a0..de3a4c8 100644 --- a/lisp/ob-exp.el +++ b/lisp/ob-exp.el @@ -167,7 +167,7 @@ options are taken from `org-babel-default-header-args'." (save-excursion (goto-char start) (while (and (< (point) end) - (re-search-forward org-babel-lob-one-liner-regexp nil t)) + (re-search-forward org-babel-lob-one-liner-regexp end t)) (unless (org-babel-in-example-or-verbatim) (let* ((lob-info (org-babel-lob-get-info)) (inlinep (match-string 11)) -- 1.7.5.4 --=-=-=--