0

My org-capture takes about 6 seconds to open up on a reasonably powerful machine, and it becomes over a minute on a cheap laptop. I decided to profile the function and here's what it gave:

    2423  97% - command-execute
    2375  95%  - call-interactively
    2302  92%   - funcall-interactively
    2299  92%    - org-capture
    2246  90%     - org-store-link
    1473  59%      - elfeed-link-store-link
    1473  59%       + byte-code
    772   31%      - org-load-modules-maybe
    596   23%       + require
    53    2%     - org-capture-select-template
    53    2%      + org-mks
    3     0%    - execute-extended-command
    3     0%     + apply
    73    2%   - byte-code
    73    2%    + read-extended-command
    31    1%  - autoload-do-load
    16    0%     byte-code
    12    0%   + provide
    2     0%   + #<compiled 0x1e082d37a5ffac44>
    1     0%   + do-after-load-evaluation
    62    2% + ...
  1. It happens that every time org-store-link is called, elfeed-link-store-link registered as one of org-link-parameters was being funcalled and loaded the whole Elfeed package along with it. So, my self-suggestion was to make elfeed-link-store-link to be added to the list only after Elfeed is loaded as whole. I declared Elfeed in my init.el through use-package with :defer t, and none of the other keywords were adequate. How can I achieve the behavior I want?

  2. Is it normal that org-load-modules-maybe alone takes 2 seconds to execute? The org-modules it's looping on seems pretty vanilla with the value being (ol-doi ol-w3m ol-bbdb ol-bibtex ol-docview ol-gnus ol-info ol-irc ol-mhe ol-rmail ol-eww). Thus, I could not see any reason for this taking too long.

Namudon'tdie
  • 159
  • 6
  • This should only happen at most *once*. After everything is loaded, both `elfeed` and the Org modules should be loaded and do not need to be loaded again. Are you seeing the slow behavior on *every* capture or only on the first one? – NickD May 19 '23 at 11:46
  • @NickD It only happens on the first run. So, as a cheap workaround I run `org-capture` just for the sake of loading everything. – Namudon'tdie May 20 '23 at 19:53

0 Answers0