From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Performance issues after upgrading from Emacs 23.3 to 24.3+prelude Date: Thu, 09 Jan 2014 20:39:48 +0100 Message-ID: <871u0h9c6z.fsf@gmail.com> References: <2014-01-06T17-25-21@devnull.Karl-Voit.at> <871u0kp2s1.fsf@bzg.ath.cx> <2014-01-09T20-05-54@devnull.Karl-Voit.at> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1LS4-0000vv-0q for emacs-orgmode@gnu.org; Thu, 09 Jan 2014 14:39:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W1LRy-0005ND-DB for emacs-orgmode@gnu.org; Thu, 09 Jan 2014 14:39:35 -0500 Received: from mail-we0-x233.google.com ([2a00:1450:400c:c03::233]:40981) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1LRx-0005Mz-WD for emacs-orgmode@gnu.org; Thu, 09 Jan 2014 14:39:30 -0500 Received: by mail-we0-f179.google.com with SMTP id q59so3186871wes.38 for ; Thu, 09 Jan 2014 11:39:28 -0800 (PST) In-Reply-To: <2014-01-09T20-05-54@devnull.Karl-Voit.at> (Karl Voit's message of "Thu, 9 Jan 2014 20:17:47 +0100") 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: news1142@Karl-Voit.at Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hello, Karl Voit writes: > IMHO, the profiler reports showed a common pattern: a reasonable > amount of CPU got into line-number-at-pos if I read the profiler > report correctly. (see below) Does the following patch improve the situation? Regards, -- Nicolas Goaziou --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-ob-core-Speed-improvement.patch >From 54b8e7466d4689be3c34f7041244563771e2178a Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Thu, 9 Jan 2014 20:36:23 +0100 Subject: [PATCH] ob-core: Speed improvement * lisp/ob-core.el (org-babel-get-inline-src-block-matches): Do not compute line number if all is needed is to know if we're on the first one. --- lisp/ob-core.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index f06cdaf..e8943c6 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -217,7 +217,7 @@ Returns non-nil if match-data set" (let ((src-at-0-p (save-excursion (beginning-of-line 1) (string= "src" (thing-at-point 'word)))) - (first-line-p (= 1 (line-number-at-pos))) + (first-line-p (= (line-beginning-position) (point-min))) (orig (point))) (let ((search-for (cond ((and src-at-0-p first-line-p "src_")) (first-line-p "[[:punct:] \t]src_") -- 1.8.5.2 --=-=-=--