GNU bug report logs - #53606
29.0.50; Very slow Customize buffer for bibtex-biblatex-entry-alist

Previous Next

Package: emacs;

Reported by: Lars Ingebrigtsen <larsi <at> gnus.org>

Date: Fri, 28 Jan 2022 15:04:02 UTC

Severity: normal

Tags: confirmed

Found in version 29.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 53606 <at> debbugs.gnu.org (full text, mbox):

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: 53606 <at> debbugs.gnu.org
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#53606: 29.0.50; Very slow Customize buffer for
 bibtex-biblatex-entry-alist
Date: Sat, 9 Sep 2023 19:23:16 -0300
Lars Ingebrigtsen <larsi <at> gnus.org> 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.





This bug report was last modified 184 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.