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: A faster derived-mode-p Date: Mon, 15 Feb 2021 00:25:57 +0200 Message-ID: <428be4d8-9b35-c581-1357-20bb6ecb1ed8@yandex.ru> References: <87k0ra9z7w.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="11055"; 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 To: Lars Ingebrigtsen , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Feb 14 23:26:54 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 1lBPqv-0002lk-7B for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Feb 2021 23:26:53 +0100 Original-Received: from localhost ([::1]:41542 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBPqu-0002ru-8R for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Feb 2021 17:26:52 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53364) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBPq9-0002PC-0l for emacs-devel@gnu.org; Sun, 14 Feb 2021 17:26:05 -0500 Original-Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:41943) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBPq5-0008Ug-77 for emacs-devel@gnu.org; Sun, 14 Feb 2021 17:26:02 -0500 Original-Received: by mail-wr1-x42c.google.com with SMTP id n6so6804705wrv.8 for ; Sun, 14 Feb 2021 14:26:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=eP5MCM5G/Bjj18guJWY20p1qNhg5kJ2/qniBigkpWQY=; b=hHWmpWl+Ul6HJWxF0xeWJS/kvU62VK9mJ0/HJg7cptPrFY+P98BPGY8qykKh2Ej7O0 qQ8kTgAHBmyZkyWDkMPJBRsER/QiWDm3u0GRHoBsgGhnLadaktBWRiL8Otw98FNqfp/+ /w5QqTUUYHOLweoKpNgvgMT7SCfR2UFn7ILucfTySh8U6g8dzTnyoO4A3ORVMwHJK+Td Z8/HHqjVMTrL1o6RBiQkpfigjqoDBw48JpEe2Imq6oYoYv9bkoI/lb4xVzQJR/j0eq8o gxJuaV3nn+lYZ3epkTUnT4ClrWlXK+a32PuhzVq5tHF4GDwTwHqqye2ePP22D5tJRjzE A+hg== 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:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=eP5MCM5G/Bjj18guJWY20p1qNhg5kJ2/qniBigkpWQY=; b=LepogCMeDLZZ0cj1pkh+5aUKZz27Ya8OdWUyTUJhWoYWddnITSkERR2PRCZHcrHFHD LPl5LCRVykpaMVXQ48P+0S2HOJDQm51VZGVhhxpr2gLgGGwlZMvdJQIPa9tMTB9fctl0 fS4S7RjwOyjnqlZVnl/DpSXdgIekqNkCvxOl9ojaY0OnQ2LLczlNs1xZby3qiWYHLePg 3JQGeymyyL+dTuT9Lpf+GJOfHzBxYweBev5KoaNDKQ35i2vUuCdTKwFlXTo83RfPR68t 90sxT1Kg81jaovYWiZtIxG87YHEP2r3N4GmUSBuKHrnwis6/C8nR3tpux5yB5YLp8J66 +YWA== X-Gm-Message-State: AOAM531NWZxycBP81vTDh0SMLkk5Pm6NkVaEBbVCUv2n69o0fpfTZ71s ZvH7ZTy2GCA/q7BZhwcRnxroR9DP71o= X-Google-Smtp-Source: ABdhPJxcYV1DxK/ArNWF/xriv5/EphpXyO2wj2Bdl4eBdvZsog0pn/fqJVJBoO3dQBU/97pa624Xpg== X-Received: by 2002:adf:cf06:: with SMTP id o6mr15664328wrj.169.1613341559613; Sun, 14 Feb 2021 14:25:59 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id l2sm22167074wmf.15.2021.02.14.14.25.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 14 Feb 2021 14:25:59 -0800 (PST) In-Reply-To: <87k0ra9z7w.fsf@gnus.org> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=raaahh@gmail.com; helo=mail-wr1-x42c.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.249, 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:264788 Archived-At: On 14.02.2021 22:22, Lars Ingebrigtsen wrote: > There are only 11K commands in the Emacs tree, so I don't know whether > the current default completion predicate is going to turn out to be > problematically slow or not. I just evaluated (length (cl-delete-if-not #'commandp obarray)) in a running Emacs session with a bunch of third-party packages installed and loaded, and that still evaluated only to 1083. So if derived-mode-p only needs to run 1000 times or so, perhaps it can still be fast enough, however inefficient it might look. I'd also recommend benchmarking with both implementations, if it's really too slow. Also see the whole other implementation approach I mentioned in another thread.