From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mauro Aranda Newsgroups: gmane.emacs.bugs Subject: bug#53606: 29.0.50; Very slow Customize buffer for bibtex-biblatex-entry-alist Date: Sat, 9 Sep 2023 19:23:16 -0300 Message-ID: <47a462c3-7f5d-02a3-4287-5e561cb2a008@gmail.com> References: <87sft7gawc.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10274"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: Lars Ingebrigtsen To: 53606@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 10 00:24:14 2023 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 1qf6NC-0002Sz-1M for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Sep 2023 00:24:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qf6N0-0002Rd-Nn; Sat, 09 Sep 2023 18:24:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qf6My-0002RR-NR for bug-gnu-emacs@gnu.org; Sat, 09 Sep 2023 18:24:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qf6My-000665-FZ for bug-gnu-emacs@gnu.org; Sat, 09 Sep 2023 18:24:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qf6N0-0004Lt-9V for bug-gnu-emacs@gnu.org; Sat, 09 Sep 2023 18:24:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87sft7gawc.fsf@gnus.org> Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Sep 2023 22:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53606 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 53606-submit@debbugs.gnu.org id=B53606.169429821416693 (code B ref 53606); Sat, 09 Sep 2023 22:24:02 +0000 Original-Received: (at 53606) by debbugs.gnu.org; 9 Sep 2023 22:23:34 +0000 Original-Received: from localhost ([127.0.0.1]:48580 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qf6MX-0004LA-JW for submit@debbugs.gnu.org; Sat, 09 Sep 2023 18:23:34 -0400 Original-Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]:62804) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qf6MS-0004Ku-V7 for 53606@debbugs.gnu.org; Sat, 09 Sep 2023 18:23:32 -0400 Original-Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-6bf038b8f87so2228912a34.1 for <53606@debbugs.gnu.org>; Sat, 09 Sep 2023 15:23:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694298199; x=1694902999; darn=debbugs.gnu.org; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=RHXRl1GwmnPz3p5LTr3rj4tYopJHneYpYCCwgqxogu8=; b=FYof1fxq8PF7t9fw/Yz8UHYhlSBKtrpxiU4szol7xILXnFDjCxdOBXBp2QYpgDVKHZ /2PfYA65S2ly9ZetmmIsZXPNetwDtPKkoFkcujH9slR8K4zHdRdOyXSugvyoH5yQ9ZxD LlMH42qP2fQy+dfCxqgxAnKNa3RjCikEPpQ1NPzV5KHKq0t/RfkEfEjM3kwBgvumqMge f1QMNRafbKMVJK85wrUSdHre4m+De68056AOYHMQeVOBMTNierua70nsj4USwx9p8uM2 OCQ9tw+PPAiJZmlkQ8zU/hYxw3nUrRszG1UI4duQSYLO7TNu+IvKm4gkNTv72i2p2Ebb XWjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694298199; x=1694902999; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=RHXRl1GwmnPz3p5LTr3rj4tYopJHneYpYCCwgqxogu8=; b=BBDDrdJiCjGf2uMlDW1HKhI/Y6FcGJoSoiYgEvAa8gIg3dkqwuKuRoaidOcOZ+CNRu xnQEzsIkJPQh8zJROgrZ8W3ctTUl9t8IrzwrlZw2Ury3tsbnI4zkmD2Ze+P3pbr8/sOm 8+Rgz8jzLssXebPssG0W9sEUVvOyAQhsuObnVKnfNiocu6mv9w5cd8lUkVoHwQ0qmV1Q XZ//TgyTHikJ7HmC0GTQL4rOr0Z5dLRfFqGGIMQA3TpK+F7gy5lT9xo5h9eCLG1kT4m8 d62WZ2ZVGVAd9HkVZ47P/mGn0ZV9NXmO2y2efGk6d6/spTue0bV2SyXTbb0KF4cl2DzG wR3g== X-Gm-Message-State: AOJu0Yw5DGClWtmtHZzJfAPHQaM4xgRwDSF+xKACNheG40RknNtZtk4E EtfMajVofGiuO/MjBXSIbhqH4wqecMY= X-Google-Smtp-Source: AGHT+IFL3bhLMkY1D8wVQf7tILop1jJsqLdxn8of18HEfm7BCoykedA/9OYk9Oi/XYNK/XFtIZ5LHw== X-Received: by 2002:a9d:73c6:0:b0:6bc:cde2:3038 with SMTP id m6-20020a9d73c6000000b006bccde23038mr3216250otk.11.1694298199642; Sat, 09 Sep 2023 15:23:19 -0700 (PDT) Original-Received: from [192.168.0.234] ([152.168.142.156]) by smtp.gmail.com with ESMTPSA id e25-20020a056830201900b006b9cb784553sm1871525otp.36.2023.09.09.15.23.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 09 Sep 2023 15:23:19 -0700 (PDT) Content-Language: en-US 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:269899 Archived-At: Lars Ingebrigtsen writes: > `M-x customize-option RET bibtex-biblatex-entry-alist RET' > > takes a very long time -- more than 20 seconds on this laptop.  It's a > long alist, but it shouldn't take that long. I don't have any concrete ideas on how to speed it up on the Widget library side.  But looking at the defcustom for bibtex-biblatex-entry-alist I noted two things that can help to create the Customize buffer more quickly: 1) It uses a custom widget derived from the lazy widget, but doesn't provide a :tag.  That makes it look awful and giving it a proper :tag reduced the buffer creation time somewhat in my testings. 2) More importantly, the bibtex-entry-alist widget looks like this: (define-widget 'bibtex-entry-alist 'lazy   "Format of `bibtex-BibTeX-entry-alist' and friends."   :type '(repeat (group (string :tag "Entry type")                         (string :tag "Documentation")                         (repeat :tag "Required fields"                                 (group (string :tag "Field")                                        (option (choice :tag "Comment" :value nil                                                        (const nil) string))                                        (option (choice :tag "Init" :value nil                                                        (const nil) string function))                                        (option (choice :tag "Alternative" :value nil                                                        (const nil) integer))))                         (repeat :tag "Crossref fields"                                 (group (string :tag "Field")                                        (option (choice :tag "Comment" :value nil                                                        (const nil) string))                                        (option (choice :tag "Init" :value nil                                                        (const nil) string function))                                        (option (choice :tag "Alternative" :value nil                                                        (const nil) integer))))                         (repeat :tag "Optional fields"                                 (group (string :tag "Field")                                        (option (choice :tag "Comment" :value nil                                                        (const nil) string))                                        (option (choice :tag "Init" :value nil                                                        (const nil) string function))                                        (option (choice :tag "Alternative" :value nil                                                        (const nil) integer))))))) Why combine option and choice? That's redundant, specially since the choice widget allows for the nil value.  Removing the `option's and just leaving the `choice's should be equivalent in functionality, and in my testings reduced the creation time to the half. I ran customize-option 5 times and got: With `option': (172.526219636 69 6.120602505999997) Without `option': (86.260726994 42 3.5430049540000113) This is without native compilation. Based on the above results and since there's no lost in functionality, I propose to make the changes to the bibtex-entry-alist widget. It is a net gain in speed, and it might make the wait bearable.