emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: jamil egdemir <unclejamil@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Fwd: slow capture templates
Date: Thu, 22 May 2014 17:25:45 -0400	[thread overview]
Message-ID: <CAOa+0osZ5LYUMY1+01SEcfr6kPOSz70vnt==aJ2wMSnm6PtONw@mail.gmail.com> (raw)
In-Reply-To: <87k39dkc18.fsf@bzg.ath.cx>

Bastien,

My apologies.  I should have been more explicit on the installation.
I followed the instructions at

http://orgmode.org/manual/Installation.html

which included the 'make autoloads' where make in this case is
actually GNU make pulled down from their packages as opposed to the
OpenBSD make.

Using M-x org-version RET I get:
Org-mode version 8.2.6 (release_8.2.6-1 @
/home/jegdemir/share/emacs/24.4.50/lisp/org/)

and so it appears the checked out org is being loaded.

In an attempt to follow you suggestion,  I fired up a few calls to
x-get-selection in my *scratch* but didn't find anything exciting:

;; let's try this with UTF8_STRING:
(x-get-selection nil 'UTF8_STRING)#("(x-get-selection value
'UTF8_STRING)" 0 35 (fontified nil) 35 36 (fontified nil
rear-nonsticky t))
(x-get-selection 'PRIMARY 'UTF8_STRING)##("rear" 0 4 (fontified t))
(x-get-selection 'SECONDARY 'UTF8_STRING)nil
(x-get-selection 'CLIPBOARD 'UTF8_STRING)#("resume" 0 6
(foreign-selection UTF8_STRING))

;; and with COMPOUND_TEXT:
(x-get-selection nil 'COMPOUND_TEXT)#("immediate" 0 9
(foreign-selection COMPOUND_TEXT))
(x-get-selection 'PRIMARY 'COMPOUND_TEXT)#("immediate" 0 9
(foreign-selection COMPOUND_TEXT))
(x-get-selection 'SECONDARY 'COMPOUND_TEXT)nil
(x-get-selection 'CLIPBOARD 'COMPOUND_TEXT)#("#(\"resume\" 0 6
(foreign-selection COMPOUND_TEXT))" 0 2 (fontified t) 2 10 (fontified
t face font-lock-string-face) 10 34 (fontified t) 34 47 (fontified t)
47 49 (fontified t))

I was hoping this would expose something since the two function calls
in org-eventually boil down to x-get-selection (I think) but no dice.
I also tried 'STRING and 'TEXT as arguments in the x-get-selection...
results were the same and execution time was snappy.

I also tried the following:

- close and restart emacs
- switched to *scratch* buffer
- instrumented X (along with org) by calling M-x
elp-instrument-package RET org RET and M-x elp-instrument-package RET
x RET
- executed (org-capture) in scratch with C-x C-e with point at the end
of the form

The resulting profile from elp immediately after last step:

org-get-x-clipboard                                           6
   115.30243587  19.217072645
org-get-x-clipboard-compat                                    6
   115.30235814  19.217059690
x-get-selection                                               24
   115.30194600  4.8042477502
x-get-selection-internal                                      24
   115.30104917  4.8042103823
org-clock-in                                                  1
   1.162223352   1.162223352
org-resolve-clocks                                            1
   1.158297155   1.158297155
org-find-open-clocks                                          3
   1.1580858859  0.3860286286
org-indent-add-properties                                     16
   0.420800437   0.0263000273
org-indent-initialize-agent                                   3
   0.4196886359  0.139896212
org-indent-initialize-buffer                                  2
   0.4195824059  0.2097912029
org-at-item-p                                                 3131
   0.2143426759  6.845...e-05
org-list-in-valid-context-p                                   329
   0.1737325780  0.0005280625
org-in-block-p                                                329
   0.1715975809  0.0005215731
org-between-regexps-p                                         2619
   0.1176125040  4.490...e-05
org-get-indentation                                           2814
   0.0492611860  1.750...e-05
org-mode                                                      3
   0.041698319   0.0138994396

and after looking at the source for x-get-selection you find that the
first thing it does is call x-get-selection-internal with appears to
map to something in xselect.c.  This happens inside select.el.gz...

Looking at the definitions of the capture templates I'm using I'm not
sure if I understand why the call is being made in the first place if
the capture template does not contain %x.  Not that I think this would
solve my deeper problem but it does seem like a good idea to check the
template before pulling the clipboard contents as a matter of course.

In any case it seems unintentional to me that using a capture template
should induce 6 calls to org-get-x-clipboard and 24 calls to
x-get-selection.

BTW, Thanks for the help B.

-jamil

  reply	other threads:[~2014-05-22 21:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22  7:07 slow capture templates jamil egdemir
2014-05-22  8:49 ` Bastien
2014-05-22 15:51   ` jamil egdemir
2014-05-22 16:34     ` Bastien
2014-05-22 21:25       ` jamil egdemir [this message]
2014-05-22 22:34         ` Fwd: " Nick Dokos
2014-05-23  5:35           ` Bastien
2014-05-23  6:07             ` Nick Dokos

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='CAOa+0osZ5LYUMY1+01SEcfr6kPOSz70vnt==aJ2wMSnm6PtONw@mail.gmail.com' \
    --to=unclejamil@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).