2

running org-cycle appears to hang sometimes. I've run

M-x profiler-start
<tab> ;; bound to org-cycle
C-g ;; to cancel apparently-hung command
M-x profiler-report

and I see that a bunch of time is spent deleting from some cache

- command-execute                                                5756  75%
 - call-interactively                                            5756  75%
  - funcall-interactively                                        5694  74%
   - org-cycle                                                   5684  74%
    - org-cycle-internal-local                                   5684  74%
     - org-show-entry                                            5684  74%
      - org-cycle-hide-drawers                                   5684  74%
       - org-element-at-point                                    5684  74%
        - org-element--cache-sync                                5684  74%
         - org-element--cache-process-request                    4206  55%
          - avl-tree-delete                                      3756  49%
           - avl-tree--do-delete                                 3627  47%
            - avl-tree--do-delete                                3244  42%
             - avl-tree--do-delete                               2830  37%
              - avl-tree--do-delete                              2203  28%
               - avl-tree--do-delete                             1607  21%
                - avl-tree--do-delete                            1217  15%
                 - avl-tree--do-delete                            674   8%
                  - avl-tree--do-delete                           326   4%
                     org-element--cache-compare                    83   1%
                     avl-tree--do-delete                           16   0%
                    org-element--cache-compare                     67   0%
                   org-element--cache-compare                     127   1%
                  org-element--cache-compare                       76   0%
                 org-element--cache-compare                       151   1%
                org-element--cache-compare                        159   2%
               org-element--cache-compare                          61   0%
              org-element--cache-compare                           85   1%
   + execute-extended-command                                      10   0%
  + byte-code                                                      62   0%
+ ...                                                            1887  24%
+ eldoc-schedule-timer                                              1   0%
+ timer-event-handler                                               1   0%

how can I dig into this further?

  • You already have your answer -- i.e., that avl-stuff -- none of that is standard. Org-mode stuff begins with org-... – lawlist Dec 31 '16 at 5:21
  • @lawlist, I think those AVL tree functions are from the avl-tree library that comes with Emacs (so, I'd say it is standard). And a quick check of the org-element source code indicates it does indeed use the avl-tree library. – Omar Jan 2 '17 at 5:42
  • I just downloaded the source code for Emacs latest public stable release of 25.1 and grepped the directory emacs-25.1/lisp/org/ for avl- and there are no matches. Perhaps you are using something other than Emacs 25.1, or perhaps you are using a version of org-mode that does not ship with Emacs 25.1? Or, perhaps you enabled some minor-mode that is interfering and using avl- ...? One idea would be to type M-x describe-mode and see what else is going on that is non-standard when using org-mode. – lawlist Jan 2 '17 at 6:14
  • @lawlist: Emacs 25.1 comes with Org 8.2.10, I believe. I can confirm that I found no occurrences of avl- in the 8.2.10 version of org-element.el. However, the current release of Org, 9.0 does use avl-tree and the 9.0 version of org-element.el has 20 occurrences of avl-. (Your previous comments made me feel I was going crazy until I remembered I always keep Org up to date.) – Omar Jan 2 '17 at 19:17
  • One idea would be to see if the performance issue goes away when using Org 8.2.10. If it does, then it may be worthwhile to submit your profile report to the org-mode mailing list explaining the differences in performance between the two versions. Nearly 50% for avl-tree--do-delete seems rather expensive. – lawlist Jan 2 '17 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.