From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#51523: 29.0.50; gnus-mime-view-part-externally very slow Date: Sun, 31 Oct 2021 17:47:57 -0400 Message-ID: References: <87v91dmcyz.fsf@gnus.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36046"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 51523@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 31 22:49:14 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mhIhW-0009B9-68 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 31 Oct 2021 22:49:14 +0100 Original-Received: from localhost ([::1]:49666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mhIhU-000248-3W for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 31 Oct 2021 17:49:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhIhK-00023w-TH for bug-gnu-emacs@gnu.org; Sun, 31 Oct 2021 17:49:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49911) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mhIhK-0008GB-Kk for bug-gnu-emacs@gnu.org; Sun, 31 Oct 2021 17:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mhIhK-0004yi-Gr for bug-gnu-emacs@gnu.org; Sun, 31 Oct 2021 17:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 31 Oct 2021 21:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51523 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 51523-submit@debbugs.gnu.org id=B51523.163571688819066 (code B ref 51523); Sun, 31 Oct 2021 21:49:02 +0000 Original-Received: (at 51523) by debbugs.gnu.org; 31 Oct 2021 21:48:08 +0000 Original-Received: from localhost ([127.0.0.1]:33224 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mhIgR-0004xS-Tw for submit@debbugs.gnu.org; Sun, 31 Oct 2021 17:48:08 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:4660) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mhIgP-0004wy-UF for 51523@debbugs.gnu.org; Sun, 31 Oct 2021 17:48:06 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 6977680580; Sun, 31 Oct 2021 17:48:00 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 1573580499; Sun, 31 Oct 2021 17:47:59 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1635716879; bh=ZdX4B/JxezUYv58cKGjsErxOFSkqyhPpAYdj7Z0Lt50=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=LIA23R9j6MoZYvbygy/7p3WFo9tU1T1T4XxVK7dfm89oA0zv03DlwQCybLlx63zLz UJvol1vHLbnA4B8K/rfgmcZireLAlO0tI6rFKhj+BhdIlOmfE6Qs3Xg0QChvgVaIPs /wp/kAbvwY7QywviSL5wLObxUI027oCCM4LrdMAkQs7fp0B9mMccvkh7a8y4fXGI5A lSErb9OTTm3GUcfW1hKtNqiAqYufVNmAM2+F3xrA66DzehQv7DjLb+xCMMGfmnDj3J gMlXAgNPJf2mpuL4n7jeHN61WLzdcLQOC+rf/J3UYujn6x3YS1T2CRGOBkXwaCkR6S atattTdFfINKg== Original-Received: from pastel (unknown [45.72.241.23]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D33451206DD; Sun, 31 Oct 2021 17:47:58 -0400 (EDT) In-Reply-To: <87v91dmcyz.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 31 Oct 2021 16:27:16 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:218721 Archived-At: Lars Ingebrigtsen [2021-10-31 16:27:16] wrote: > Stefan Monnier 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