From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Current mode command discovery Date: Thu, 18 Feb 2021 19:15:10 +0200 Message-ID: References: <87v9aubm96.fsf@gnus.org> <87czwzfn9p.fsf@telefonica.net> <87eehfnd83.fsf@gnus.org> <1fb773f6-1480-53ce-08ae-1f7d0ba23428@yandex.ru> <87k0r637k4.fsf@gnus.org> <80e8c434-888d-23c5-13f0-c513bbf13ee4@yandex.ru> <8735xtznrh.fsf@gnus.org> <70fd2374-23ea-1c03-a4e4-97a370a41acf@yandex.ru> <87h7m9wjvl.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1092"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: =?UTF-8?Q?=c3=93scar_Fuentes?= , emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Feb 18 18:17:06 2021 Return-path: Envelope-to: ged-emacs-devel@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 1lCmvK-0000AW-AC for ged-emacs-devel@m.gmane-mx.org; Thu, 18 Feb 2021 18:17:06 +0100 Original-Received: from localhost ([::1]:51670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lCmvJ-00044c-AO for ged-emacs-devel@m.gmane-mx.org; Thu, 18 Feb 2021 12:17:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCmtZ-00030E-If for emacs-devel@gnu.org; Thu, 18 Feb 2021 12:15:17 -0500 Original-Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]:41356) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lCmtX-0004Ng-J4 for emacs-devel@gnu.org; Thu, 18 Feb 2021 12:15:17 -0500 Original-Received: by mail-ed1-x536.google.com with SMTP id i14so5024971eds.8 for ; Thu, 18 Feb 2021 09:15:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=u8XP47nX/Z2vpZTrvmY7KJ9LNYLiwnx0VN9egKSZN3U=; b=S2JANeKHB7I6VAyPO1h4inbSpnHKzqcBOPeccIkgmiyLil2wckiLUewLFG1DVBmsnx n+Jk4iPap5dHv1DPsg0TASDlk+KFJ1o53L5YCOBbeSbygeC1l5mDYwB0TvtZKA1z41n7 SMoW6G8O8wIbyUbCkDgy8rjZZ4N0ttbgfM2qHerTw4U7tQeY+QdWhb8n/0HBajINQf29 YDs1RRVS52Dh7MqyhN3m0inyKHPdGIUKHgjss5N2F6aFFYM9ZU2ZeMhUI3vMGv1RRPAh ssSyYzup7nfzsf+vz6YFsK3cUGnm0ibqgROGUjUJr2ZkrmWz0+w0BC7101csEtl6okan 73AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=u8XP47nX/Z2vpZTrvmY7KJ9LNYLiwnx0VN9egKSZN3U=; b=hdIBJHjrqxwkhmX7DygF39qOFJvyI2t6xvhGwFwA82bf7lu7IRgMduIYQvYSeombmc 4yu2GCncW4OjqYiLhTrP1Pd++4KXBDVer9AFxZKRRqL3I0lR4y5QvvkaOSaak8jjssHL YQN970DJN+Gzl4kJLLdkQh3+/zoQxmM10qxky1QjFxLwGqo6EmBng+rxQjisowgXVlC+ oevMwivE9YYVhZXfE81NJT1X9mGZwEtsrpmfRsp7yTnLTRbuIBHXI5mU4oIf5NT8q7Ps Ev94EjKTgBJuRDp7l8iBY5FCRYMKDOlp5QQFCUseWBvdZWUVtyyYzC3QcYIVo0xFGu0G LS/Q== X-Gm-Message-State: AOAM5335nLeHUE/HjRrsTvGwk91G6Jo7lcD+Ak25WYArutlD62fLhrnP LLTCJaVOEBKshWKZAA6QK9KizNo67mw= X-Google-Smtp-Source: ABdhPJy0lsIuZY9lo2u4nFaK5XupCrHWADebC4wO/Nkocghy5womb9SB8S45HQbixrNDDq8DwMfXnA== X-Received: by 2002:aa7:d6d7:: with SMTP id x23mr5098755edr.73.1613668513342; Thu, 18 Feb 2021 09:15:13 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id w3sm2619701eds.49.2021.02.18.09.15.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Feb 2021 09:15:12 -0800 (PST) In-Reply-To: <87h7m9wjvl.fsf@gnus.org> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=raaahh@gmail.com; helo=mail-ed1-x536.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:265166 Archived-At: On 18.02.2021 16:06, Lars Ingebrigtsen wrote: > Dmitry Gutov writes: > >> On 18.02.2021 12:14, Lars Ingebrigtsen wrote: >>> I guess the main performance difference is in loading the .elc files -- >>> parsing and applying all the `put's. >> >> Hm. Are you saying that the use of (declare (completion ...)) form >> currently requires us to parse all .elc files? > > No -- I'm saying that I guess the M-x completion performance difference > is probably very small between the two approaches. The current approach > is to stash the data in the bytecode object and retrieving it with > `command-modes' vs. doing `get' on the symbol. `command-modes' is O(1) > and `get' is O(n), but the n is so small on typical symbols that I doubt > there's much of a measurable difference. And `get' has a bytecode > opcode, so it may even be faster for all I know. All right. > But I haven't measured. > > The disadvantage in using a `put' for this data is mainly in that it > makes .elc files larger (and therefore slower to load). The difference will probably be higher in autoload files (which will require separate 'put' forms to be added, right?). If it were up to me, I'd see if it's possible to reuse some slots in autoload byte-compiled form in a backward-compatible fashion, and then consider, depending on the actual performance difference, maybe do break it in some future version of Emacs. It's not as important as source-level compatibility, IMO.