emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: news1142@Karl-Voit.at
Cc: emacs-orgmode@gnu.org
Subject: Re: Performance issues after upgrading from Emacs 23.3 to 24.3+prelude
Date: Thu, 09 Jan 2014 20:39:48 +0100	[thread overview]
Message-ID: <871u0h9c6z.fsf@gmail.com> (raw)
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")

[-- Attachment #1: Type: text/plain, Size: 297 bytes --]

Hello,

Karl Voit <devnull@Karl-Voit.at> 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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ob-core-Speed-improvement.patch --]
[-- Type: text/x-diff, Size: 960 bytes --]

From 54b8e7466d4689be3c34f7041244563771e2178a Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <n.goaziou@gmail.com>
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


  reply	other threads:[~2014-01-09 19:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-06 16:54 Performance issues after upgrading from Emacs 23.3 to 24.3+prelude Karl Voit
2014-01-07  9:19 ` Bastien
2014-01-07 13:50   ` Karl Voit
2014-01-09 16:24     ` Eric S Fraga
2014-01-09 19:17   ` Karl Voit
2014-01-09 19:39     ` Nicolas Goaziou [this message]
2014-01-09 20:24       ` Performance issues after upgrading from Emacs 23.3 to 24.3 Karl Voit
2014-01-09 21:10         ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871u0h9c6z.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=news1142@Karl-Voit.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).