[emacs-w3m:13934] Re: emacs-w3m slow, and various versions of it

Samuel Wales <[email protected]> Sat, 30 Sep 2023 23:06:21 -0700
Newsgroups gmane.emacs.w3m
Message-ID <CAJcAo8uK4R-DMEbM=vQXwQaTDF=bUjf7w=Zmo99YUw7S5WKomw@mail.gmail.com>
trying again, here is profile and version numbers.  note that the call
counts jumped by a huge amount.  i launched eacs with my .emacs,
started profiler, tried a search [which took a whhile), stopped
profeiler, and reported profiler.

Its value is "w3m/0.5.3+git20190105"

- command-execute                                         406,625,133  99%
 - autoload-do-load                                       403,281,852  99%
  - byte-code                                             403,268,388  99%
   - require                                              403,242,516  99%
    - defvar                                              399,320,008  98%
     - byte-code                                          399,212,700  98%
      - mailcap-mime-info                                 398,977,584  98%
       - mailcap-parse-mailcaps                           330,991,369  81%
        - mailcap-parse-mailcap                           264,903,337  65%
         - mailcap-mailcap-entry-passes-test               84,533,542  20%
          - getenv                                         46,603,852  11%
           - called-interactively-p                        18,918,964   4%
            + #<compiled 0x1fdedc977433>                   12,576,266   3%
              run-hook-with-args-until-success              6,342,336   1%
          + split-string                                   31,954,480   7%
           mailcap-replace-regexp                          26,720,528   6%
           mailcap-parse-mailcap-extras                    18,399,350   4%
         + insert-file-contents                             7,814,456   1%
           generate-new-buffer                                497,848   0%
         + #<compiled 0x156d325eff99>                          29,568   0%
        + getenv                                               59,136   0%
         mailcap-possible-viewers                          58,308,816  14%
       - mail-header-parse-content-type                     4,509,587   1%
        + rfc2231-parse-string                              3,606,458   0%
          rfc2047-decode-string                               476,600   0%
       + mailcap-viewer-passes-test                         1,219,552   0%
       + split-string                                         502,084   0%
       + mailcap-unescape-mime-test                           187,843   0%
       + sort                                                  86,040   0%
      + split-string                                          101,016   0%
      + regexp-opt                                             95,148   0%
     + w3m-make-minor-mode-keymap                               4,224   0%
     + mapcar                                                   1,048   0%
    + defconst                                              1,515,496   0%
    + byte-code                                             1,461,618   0%
    + do-after-load-evaluation                                153,742   0%
   + custom-declare-variable                                    7,392   0%
   + mapcar                                                     2,104   0%
  + do-after-load-evaluation                                    1,056   0%
  + substitute-env-in-file-name                                 1,024   0%
 + call-interactively                                       3,325,881   0%
+ redisplay_internal (C function)                               4,216   0%
+ timer-event-handler                                           1,520   0%
+ type-break-run-tb-post-command-hook                             176   0%
  ...                                                               0   0%

-------
- command-execute                                         406,625,133  99%
 - autoload-do-load                                       403,281,852  99%
  - byte-code                                             403,268,388  99%
   - require                                              403,242,516  99%
    - defvar                                              399,320,008  98%
     - byte-code                                          399,212,700  98%
      - mailcap-mime-info                                 398,977,584  98%
       - mailcap-parse-mailcaps                           330,991,369  81%
        - mailcap-parse-mailcap                           264,903,337  65%
         - mailcap-mailcap-entry-passes-test               84,533,542  20%
          - getenv                                         46,603,852  11%
           - called-interactively-p                        18,918,964   4%
            + #<compiled 0x1fdedc977433>                   12,576,266   3%
              run-hook-with-args-until-success              6,342,336   1%
          + split-string                                   31,954,480   7%
           mailcap-replace-regexp                          26,720,528   6%
           mailcap-parse-mailcap-extras                    18,399,350   4%
         + insert-file-contents                             7,814,456   1%
           generate-new-buffer                                497,848   0%
         + #<compiled 0x156d325eff99>                          29,568   0%
        + getenv                                               59,136   0%
         mailcap-possible-viewers                          58,308,816  14%

-------
- command-execute                                         406,625,133  99%
 - autoload-do-load                                       403,281,852  99%
  - byte-code                                             403,268,388  99%
   - require                                              403,242,516  99%
    - defvar                                              399,320,008  98%
     - byte-code                                          399,212,700  98%
      - mailcap-mime-info                                 398,977,584  98%
       - mailcap-parse-mailcaps                           330,991,369  81%
        - mailcap-parse-mailcap                           264,903,337  65%
         - mailcap-mailcap-entry-passes-test               84,533,542  20%
          - getenv                                         46,603,852  11%
           - called-interactively-p                        18,918,964   4%
            + #<compiled 0x1fdedc977433>                   12,576,266   3%
              run-hook-with-args-until-success              6,342,336   1%
          + split-string                                   31,954,480   7%
           mailcap-replace-regexp                          26,720,528   6%
           mailcap-parse-mailcap-extras                    18,399,350   4%
         + insert-file-contents                             7,814,456   1%
           generate-new-buffer                                497,848   0%
         + #<compiled 0x156d325eff99>                          29,568   0%
        + getenv                                               59,136   0%
         mailcap-possible-viewers                          58,308,816  14%
       + mail-header-parse-content-type                     4,509,587   1%
       + mailcap-viewer-passes-test                         1,219,552   0%
       + split-string                                         502,084   0%
       + mailcap-unescape-mime-test                           187,843   0%
       + sort                                                  86,040   0%
      + split-string                                          101,016   0%
      + regexp-opt                                             95,148   0%
     + w3m-make-minor-mode-keymap                               4,224   0%
     + mapcar                                                   1,048   0%
    + defconst                                              1,515,496   0%
    + byte-code                                             1,461,618   0%
    + do-after-load-evaluation                                153,742   0%
   + custom-declare-variable                                    7,392   0%
   + mapcar                                                     2,104   0%
  + do-after-load-evaluation                                    1,056   0%
  + substitute-env-in-file-name                                 1,024   0%
 + call-interactively                                       3,325,881   0%
+ redisplay_internal (C function)                               4,216   0%
+ timer-event-handler                                           1,520   0%
+ type-break-run-tb-post-command-hook                             176   0%
  ...                                                               0   0%


On 6/9/23, Samuel Wales <[email protected]> wrote:
> moseying into 27 from 26 as my luddite practices have it, i find that
> the first invocation of emacs-w3m's w3m command takes 8s or so
> [profile below] which
> is slower.  subsequent invocation is fast.  any clues?  why the
> mailcap?
>
> i am using debian w3m-el-snapshot version:
>
> w3m-el-snapshot:
>   Installed: 1.4.632+0.20181112-2
>   Candidate: 1.4.632+0.20181112-2
>   Version table:
>  *** 1.4.632+0.20181112-2 500
>         500 https://deb.debian.org/debian buster/main amd64 Packages
>         100 /var/lib/dpkg/status
>
> i have tried the cvs version as i used to do, but perhaps it on longer
> exists [i don't know cvs at all]:
>
> $ cvs -q -d:pserver:[email protected]:/storage/cvsroot co emacs-w3m
> Fatal error, aborting.
> anonymous: no such user
>
> here is the profile:
>
>  - command-execute                                                1985  93%
>  - autoload-do-load                                              1917  90%
>   - defvar                                                       1895  89%
>    - byte-code                                                   1894  89%
>     - mailcap-mime-info                                          1885  88%
>      - mailcap-parse-mailcaps                                    1851  87%
>       - mailcap-parse-mailcap                                    1564  73%
>        + mailcap-mailcap-entry-passes-test                        621  29%
>          mailcap-replace-regexp                                   188   8%
>        + mailcap-parse-mailcap-extras                             104   4%
>          mailcap-add-mailcap-entry                                 71   3%
>        + insert-file-contents                                       7   0%
>          #<compiled 0x156271950955>                                 3   0%
>        mailcap-possible-viewers                                    11   0%
>      + mail-header-parse-content-type                              10   0%
>        mailcap-viewer-passes-test                                   3   0%
>      + seq-find                                                     1   0%
>       regexp-opt                                                    1   0%
>   + byte-code                                                      17   0%
>  + call-interactively                                              68   3%
> + ...                                                             136   6%
> + w3m-check-current-position                                        1   0%
> + timer-event-handler                                               1   0%
>
>
> thank you.
>
> --
> The Kafka Pandemic
>
> A blog about science, health, human rights, and misopathy:
> https://thekafkapandemic.blogspot.com
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com