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: Wed, 03 Nov 2021 14:56:47 -0400 Message-ID: References: <6abcac838b7f89ee4e21@heytings.org> <831r3zncow.fsf@gnu.org> <6abcac838b521de77925@heytings.org> <83zgqnlt7t.fsf@gnu.org> <87y267revf.fsf@gnus.org> <83v91blrux.fsf@gnu.org> <87o873rdyx.fsf@gnus.org> <83r1bzlrkw.fsf@gnu.org> <87bl33rdrv.fsf@gnus.org> <83mtmnlr93.fsf@gnu.org> <87wnlrpyok.fsf@gnus.org> <6abcac838b9fc735488f@heytings.org> <83sfwek2wu.fsf@gnu.org> <11d5fecb444b249c7dd2@heytings.org> <11d5fecb44159efae35a@heytings.org> <83h7ctidiy.fsf@gnu.org> <11d5fecb4464cb0c8d2d@heytings.org> <11d5fecb44bcf5508ef3@heytings.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="11073"; 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, Eli Zaretskii , larsi@gnus.org To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 03 19:57:26 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 1miLRt-0002if-KE for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Nov 2021 19:57:25 +0100 Original-Received: from localhost ([::1]:58756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1miLRs-0004rG-Hn for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Nov 2021 14:57:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38980) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1miLRW-0004G7-P6 for bug-gnu-emacs@gnu.org; Wed, 03 Nov 2021 14:57:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57943) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1miLRW-0003oS-G5 for bug-gnu-emacs@gnu.org; Wed, 03 Nov 2021 14:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1miLRW-0004RL-EE for bug-gnu-emacs@gnu.org; Wed, 03 Nov 2021 14:57: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: Wed, 03 Nov 2021 18:57: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.163596581817054 (code B ref 51523); Wed, 03 Nov 2021 18:57:02 +0000 Original-Received: (at 51523) by debbugs.gnu.org; 3 Nov 2021 18:56:58 +0000 Original-Received: from localhost ([127.0.0.1]:41256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1miLRS-0004R0-0v for submit@debbugs.gnu.org; Wed, 03 Nov 2021 14:56:58 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:5147) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1miLRQ-0004Qk-7T for 51523@debbugs.gnu.org; Wed, 03 Nov 2021 14:56:56 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id ABCD3441FD5; Wed, 3 Nov 2021 14:56:50 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 28482441D18; Wed, 3 Nov 2021 14:56:49 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1635965809; bh=EU3Wwte7t0dV7pt+Y0tFRh92P/mMfQjvTw2lPLyZRo8=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=SB7tAhKw9kUEqRMy2VZCrtxbv2/DXiVpFKaoyeh+QB090b0tJX+CvAaETM+hCcyZF iNQGs710P8OLWF3ptCPP002vxVvGLePYXMuPw93kr22nSI+2xlPaOjDvyouCztRGtc S3plfzz855n9le45mxCC0cOD0gvTEHR5HK+SJspGfeaARj7sgBfEKAtkJUAu98HEYW w/oaVTCbkhrLcl+LY9UHkUYcistcUAs0LXsDv/iL/O5dmLW5ZxbOVaYRlFHOU/YAYC B7YtB6RbiQPoq4AmTDXWheiVuVjvvAoFmwhUYwakdxYeysBgZ9YoQq3uOSLCldBagW dmCglHIz685Ag== Original-Received: from pastel (unknown [45.72.241.23]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id DD241120676; Wed, 3 Nov 2021 14:56:48 -0400 (EDT) In-Reply-To: <11d5fecb44bcf5508ef3@heytings.org> (Gregory Heytings's message of "Wed, 03 Nov 2021 15:20:08 +0000") 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:218893 Archived-At: >>> - (sym (concat (symbol-name tag) "@" file)) >>> + (sym (concat (symbol-name tag) "@" >>> + (if (file-name-absolute-p file) >>> + file >>> + (expand-file-name file)))) >> (cons tag (if (file-name-absolute-p file) file (expand-file-name file))) >> is more efficient. > I don't see a performance impact in my tests, but I'll trust the master. It's likely lost in the noise, indeed, but `cons` just allocates a single 2-word object, whereas your concat will allocate a Lisp_String object (4-word object) plus the actual byte array (of N+M+1 bytes). [ And if you're unlucky and one of the strings has text-properties applied to it, then you get a fair bit more since the interval tree then needs to be copied (and merged if both strings have properties). ] It also gives you cleaner behavior, since it avoids the possibility of freak collisions when tag or file contains `@`. IOW, it should be the natural choice. Stefan