[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Performance issues after upgrading from Emacs 23.3 to 24.3+prelu
From: |
Nicolas Goaziou |
Subject: |
Re: [O] Performance issues after upgrading from Emacs 23.3 to 24.3+prelude |
Date: |
Thu, 09 Jan 2014 20:39:48 +0100 |
Hello,
Karl Voit <address@hidden> 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
>From 54b8e7466d4689be3c34f7041244563771e2178a Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <address@hidden>
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