bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#51523: 29.0.50; gnus-mime-view-part-externally very slow


From: Stefan Monnier
Subject: bug#51523: 29.0.50; gnus-mime-view-part-externally very slow
Date: Sun, 31 Oct 2021 17:47:57 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Lars Ingebrigtsen [2021-10-31 16:27:16] wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> As the title says, I find this command terribly slow, in the sense that
>> it takes several seconds for Emacs to give me a prompt asking for the
>> mime type to use.  I usually use this command on PDF attachments (and
>> the profile below was for a PDF labeled as application/octet-stream).
>
> Hm.
>
> (progn
>   (require 'mailcap)
>   (benchmark-run 1 (mailcap-mime-info "application/octet-stream")))
>
> takes 0.02s for me.  Do you have very long and involved mailcap files or
> something? 

Not sure if it's large or not, it's whatever comes with Debian, AFAIK.
(length (mailcap-mime-types)) says 1181,
and (benchmark-run 1 (mapcar #'mailcap-mime-info (mailcap-mime-types))))
tells me it takes about 4s.

> Looks like a significant amount of time is taken by
> `find-auto-encoding'?  Isn't that odd?

Could be.  To me, the surprise (and what I'd blame as the cause of the
problem) is that we re-read the mailcap file(s) every time (i.e. 1181
times plus 1 time for `mailcap-mime-types`).


        Stefan






reply via email to

[Prev in Thread] Current Thread [Next in Thread]