Re: emacs / vim - time taken to open threads

Subject: Re: emacs / vim - time taken to open threads

Date: Wed, 25 Mar 2015 11:21:06 -0000

To: Tomi Ollila

Cc: Matthew Lear, notmuch@notmuchmail.org

From: Matthew Lear


>> My experience is that the emacs interface is faster than the vim one.
>> At least I don't have an examples handy where emacs is slower than the
>> vim interface at rendering a thread. At a wild guess, I suspect it has
>> to do with how many attachments there are, and the emacs UI being
>> overenthusiastic about processing attachements.
>
> I've seen over 15 seconds of load time when opening some 20+ message
> thread -- and jumping through messages has been slow in emacs ui.

Here's two attachments obtained using the in-built profiler in emacs 24 -
one for memory profiling and one for cpu. This particular thread took > 30
secs to load and emacs was locked up the entire time. I'm no lisp expert,
but perhaps somebody could interpret this and possible suggest what could
be going on..? W.r.t. both cpu and memory usage, quite a lot of time seems
to be spent in indent-rigidly and notmuch-show-insert-thread.

Cheers,
--  Matt
- command-execute                                       1,274,239,745  99%
 - call-interactively                                   1,274,239,745  99%
  - notmuch-search-show-thread                          1,244,222,992  97%
   - notmuch-show                                       1,244,222,992  97%
    - notmuch-show-build-buffer                         1,244,184,644  97%
     - notmuch-show-insert-forest                       1,052,295,452  82%
      - mapc                                            1,052,295,452  82%
       - #<compiled 0xd784f3>                           1,052,295,452  82%
        - notmuch-show-insert-thread                    1,052,295,452  82%
         - mapc                                         1,052,295,452  82%
          - #<compiled 0xd784cd>                        1,052,295,452  82%
           - notmuch-show-insert-tree                   1,052,295,452  82%
            - notmuch-show-insert-thread                  840,006,831  65%
             - mapc                                       840,006,831  65%
              - #<compiled 0xd784cd>                      840,006,831  65%
               - notmuch-show-insert-tree                 840,006,831  65%
                - notmuch-show-insert-thread              475,772,280  37%
                 - mapc                                   475,772,280  37%
                  - #<compiled 0xd784cd>                  475,772,280  37%
                   - notmuch-show-insert-tree             475,772,280  37%
                    - notmuch-show-insert-thread          393,675,698  30%
                     - mapc                               393,675,698  30%
                      - #<compiled 0xd784cd>              393,675,698  30%
                       - notmuch-show-insert-tree         393,675,698  30%
                        - notmuch-show-insert-msg         393,670,578  30%
                           indent-rigidly                 378,976,399  29%
                         + notmuch-show-insert-headers      8,573,181   0%
                         + notmuch-show-strip-re               38,912   0%
                         + notmuch-show-insert-headerline        21,748   0%
                         + notmuch-show-message-visible         5,264   0%
                           notmuch-show-set-message-properties         3,096   0%
                           make-overlay                         1,418   0%
                    + notmuch-show-insert-msg              82,096,582   6%
                - notmuch-show-insert-msg                 364,233,495  28%
                 + notmuch-show-insert-body               237,892,232  18%
                   indent-rigidly                         123,850,002   9%
                 + notmuch-show-insert-headers                377,077   0%
                 + notmuch-show-insert-headerline              85,340   0%
                 + notmuch-show-strip-re                       20,556   0%
                 + notmuch-show-headers-visible                 4,208   0%
                 + notmuch-show-message-visible                 1,056   0%
            - notmuch-show-insert-msg                     212,283,421  16%
               indent-rigidly                             155,843,920  12%
             + notmuch-show-insert-body                    51,496,368   4%
             + notmuch-show-insert-headers                    379,990   0%
             + notmuch-show-insert-headerline                  93,694   0%
             + notmuch-show-strip-re                           17,802   0%
             + notmuch-show-message-visible                     1,056   0%
             + notmuch-show-set-message-properties              1,056   0%
     - notmuch-query-get-threads                          180,741,671  14%
      - apply                                             180,741,671  14%
       - notmuch-call-notmuch-sexp                        180,741,671  14%
        - notmuch-call-notmuch--helper                    175,917,905  13%
           apply                                          175,917,905  13%
        + make-temp-file                                      101,654   0%
          generate-new-buffer                                   1,029   0%
     + jit-lock-register                                   11,145,353   0%
     + notmuch-show-strip-re                                    1,144   0%
       replace-regexp-in-string                                 1,024   0%
    + notmuch-show-goto-first-wanted-message                   24,480   0%
    + switch-to-buffer                                         12,839   0%
  + helm-M-x                                               29,989,777   2%
  + previous-line                                              17,280   0%
  + next-line                                                   9,696   0%
+ notmuch-show-command-hook                                   266,546   0%
+ ...                                                          44,578   0%
- redisplay_internal (C function)                               7,648   0%
   file-remote-p                                                5,600   0%
 + kill-this-buffer-enabled-p                                   2,048   0%
  mouse-fixup-help-message                                      1,024   0%

Thread: