Subject: bug#53606: 29.0.50; Very slow Customize buffer for bibtex-biblatex-entry-alist

From: Mauro Aranda <[email-masked]>
Date: Sun, 10 Sep 2023 06:49:29 -0300

On 10/9/23 02:01, Eli Zaretskii wrote:
 >> Date: Sat, 9 Sep 2023 19:51:23 -0300
 >> From: Mauro Aranda <[email-masked]>
 >>
 >> On 9/9/23 19:23, Mauro Aranda wrote:
 >>  > 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.
 >>
 >> Hmm, spoke too soon :-(.  Using option is not as redundant as I
 >> thought it was.  Using `choice's alone would set all the values that
 >> are nil in the group like so: ("author" nil nil nil), while using it
 >> with `option' allows for setting it as: ("author")
 >>
 >> So that's something to consider.
 >
 > Thanks for looking into this issue.
 >
 > Could you please profile this slow operation and post the completely
 > unfolded profile?  I think we should try to understand what exactly
 > takes so much time in this case.

Here it is.  I also attach the result of C-x C-w in the report buffer,
just in case.

        25262  97%  - call-interactively
        25262  97%   - funcall-interactively
        25262  97%    - eval-last-sexp
        25262  97%     - elisp--eval-last-sexp
        25262  97%      - eval
        25262  97%       - progn
        25262  97%        - progn
        25258  97%         - customize-option
        25246  97%          - custom-buffer-create
        25246  97%           - custom-buffer-create-internal
        24870  96%            - mapcar
        24854  95%             - #<compiled -0x17c1d5ffa7b0b3ca>
        24854  95%              - widget-create
        24854  95%               - widget-apply
        24854  95%                - widget-default-create
        24854  95%                 - widget-apply
        24854  95%                  - custom-variable-value-create
        24842  95%                   - widget-create-child-and-convert
        24842  95%                    - widget-apply
        24842  95%                     - widget-default-create
        24838  95%                      - widget-apply
        24834  95%                       - widget-type-value-create
        24834  95%                        - widget-create-child-value
        24834  95%                         - widget-apply
        24834  95%                          - widget-default-create
        24834  95%                           - widget-apply
        24834  95%                            - 
widget-editable-list-value-create
        24834  95%                             - 
widget-editable-list-entry-create
        24690  95%                              - widget-create-child-value
        24690  95%                               - widget-apply
        24690  95%                                - widget-default-create
        24682  95%                                 - widget-apply
        24682  95%                                  - 
widget-group-value-create
        24670  95%                                   - 
widget-create-child-value
        24670  95%                                    - widget-apply
        24670  95%                                     - 
widget-default-create
        24334  93%                                      - widget-apply
        15974  61%                                       - 
widget-checklist-value-create
        15970  61%                                        - 
widget-checklist-add-item
         7107  27%                                         - 
widget-create-child
         7099  27%                                          - widget-apply
         7099  27%                                           - 
widget-default-create
         4187  16% delete-char
         2120   8%                                            - widget-apply
         2120   8%                                             - 
widget-choice-value-create
         2112   8%                                              - 
widget-create-child-value
         2108   8%                                               - 
widget-apply
         2108   8%                                                - 
widget-default-create
         1428 5%                                                   
delete-char
          308 1%                                                   princ
            4 0% re-search-forward
            4   0% widget-put
            4   0%                                              - 
widget-inline-p
            4   0% widget-get
           12   0%                                            - 
substitute-command-keys
            4   0%                                             - 
generate-new-buffer
            4   0% get-buffer-create
            4   0% make-closure
           12   0%                                            - 
widget-specify-button
           12   0%                                             - 
widget-apply
            8   0%                                              - 
widget-default-button-face-get
            4   0% widget-get
            4   0%                                               - 
widget-apply
            4   0%                                                - 
widget-default-button-face-get
            4   0% - widget-apply
            4   0% - widget-default-button-face-get
            4 0%                                                   - 
widget-apply
            4 0%                                                    - 
widget-default-button-face-get
            4 0%                                                     - 
widget-apply
            4 0%                                                      - 
widget-default-button-face-get
            4 0%                                                       - 
widget-apply
            4 0%                                                        
- widget-default-button-face-get
            4 0%                                                         
- widget-apply
            4 
0%                                                          - 
widget-default-button-face-get
            4 
0%                                                           - widget-apply
            4 
0%                                                            - 
widget-default-button-face-get
            4 0% widget-get
            8   0% re-search-forward
            4   0% undo-auto--undoable-change
            4   0% widget-get
            4   0% widget-put
            4   0% widget-get-indirect
            4   0%                                          - widget-copy
            4   0%                                           - widget-apply
            4   0%                                            - 
widget-types-copy
            4   0%                                             - mapcar
            4   0%                                              - 
widget-copy
            4   0% widget-apply
         4027  15%                                         - apply
         4027  15%                                          - 
widget-create-child-and-convert
         4007  15%                                           - widget-apply
         4007  15%                                            - 
widget-default-create
         2712  10% delete-char
          743   2%                                             - 
widget-apply
          739   2%                                              - 
widget-toggle-value-create
          492   1%                                               - 
widget-image-insert
          492   1%                                                - 
insert-image
            4   0% - add-text-properties
            4 0% undo-auto--undoable-change
          207   0%                                               - 
widget-image-find
          199   0%                                                - 
find-image
          152   0% - apply
          152   0% - create-image
          148 0%                                                   - 
image-type
          148 0%                                                    - 
image-type-from-file-header
           68 0%                                                     - 
insert-file-contents-literally
           64 0%                                                      - 
insert-file-contents
            4 0%                                                       - 
after-insert-file-set-coding
            4 0% find-new-buffer-file-coding-system
           60 0% file-readable-p
            4 0% image-type-from-buffer
            4 0%                                                     - 
#<compiled -0x1c8e7723716d5d9f>
            4 0% kill-buffer
            4 0% set-buffer-multibyte
            4 0% image-compute-scaling-factor
           43   0% - image-search-load-path
           31 0% file-readable-p
            8 0% expand-file-name
            4 0% image--set-property
           28   0%                                               - 
substitute-command-keys
           12   0%                                                - 
#<compiled -0x1c8e7723a0f1519f>
           12   0% - kill-buffer
            8   0% - replace-buffer-in-windows
            4 0% window-normalize-buffer
            4 0%                                                   - 
unrecord-window-buffer
            4 0%                                                    - 
assq-delete-all
            4 0% assoc-delete-all
            8   0%                                                - 
generate-new-buffer
            8 0% get-buffer-create
            8   0% widget-get
            4   0%                                               - 
widget-value
            4   0% widget-apply
           24   0%                                             - 
widget-specify-button
            8   0% widget-get
            4   0% make-overlay
            4   0% overlay-put
            4   0% functionp
           20   0% re-search-forward
            4   0%                                             - 
widget-clear-undo
            4   0% buffer-disable-undo
           16   0%                                           - apply
           16   0%                                            - 
widget-convert
           12   0%                                             - 
widget-value-convert-widget
           12   0% widget-get
         2492   9%                                         - 
widget-create-child-value
         2492   9%                                          - widget-apply
         2492   9%                                           - 
widget-default-create
         1300   5% delete-char
          956   3%                                            - widget-apply
          956   3%                                             - 
widget-choice-value-create
          956   3%                                              - 
widget-create-child-value
          956   3%                                               - 
widget-apply
          948   3%                                                - 
widget-default-create
          628 2%                                                   
delete-char
           80   0% - widget-apply
           80 0% widget-field-value-create
           52 0%                                                   princ
            8 0% re-search-forward
            8   0%                                                - 
#<compiled 0x66e1b40451af649>
            8   0% - widget-sexp-value-to-internal
            4 0%                                                    
string-match
            4   0% - pp-to-string
            4 0%                                                   - 
#<compiled -0x1c8e7722b2c0b59f>
            4 0% kill-buffer
           16   0%                                            - 
substitute-command-keys
            8   0%                                             - 
#<compiled -0x1c8e77397563719f>
            8   0%                                              - 
kill-buffer
            8   0%                                               - 
replace-buffer-in-windows
            8   0%                                                - 
unrecord-window-buffer
            4 0% window-prev-buffers
            4   0% - window-normalize-window
            4 0% window-live-p
            4   0%                                             - 
generate-new-buffer
            4   0% get-buffer-create
            8   0%                                            - 
widget-specify-button
            4   0% widget-get
            4   0%                                             - 
widget-apply
            4   0%                                              - 
widget-default-mouse-face-get
            4   0% widget-get
            4   0% re-search-forward
            4   0%                                            - 
widget-clear-undo
            4   0% buffer-disable-undo
         1864   7% delete-char
            8   0% re-search-forward
            4   0%                                         - widget-apply
            4   0%                                          - 
widget-default-deactivate
            4   0%                                           - 
widget-specify-inactive
            4   0% make-overlay
            4   0% widget--should-indent-p
            4   0% widget-get
         7848  30%                                       - 
widget-editable-list-value-create
         7828  30%                                        - 
widget-editable-list-entry-create
         4112  15%                                         - 
widget-create-child-value
         4088  15%                                          - widget-apply
         4088  15%                                           - 
widget-default-create
         3576  13%                                            - widget-apply
         3576  13%                                             - 
widget-group-value-create
         2864  11%                                              - 
widget-create-child-value
         2848  10%                                               - 
widget-apply
         2840  10%                                                - 
widget-default-create
         2084 8%                                                   
delete-char
            8 0% re-search-forward
            8   0%                                               - 
widget-copy
            4   0% widget-apply
            4   0% widget-get
            4   0% widget-put
          696   2% insert-char
            8   0%                                              - 
widget-match-inline
            4   0%                                               - 
widget-inline-p
            4   0% widget-get
            4   0%                                               - 
widget-apply
            4   0%                                                - 
widget-checklist-match-inline
            4   0% - widget-match-inline
            4   0% - widget-inline-p
            4 0%                                                   - 
widget-apply
            4 0% widget-choice-inline-bubbles-p
            4   0% widget--should-indent-p
          348   1% delete-char
            4   0%                                            - 
undo-auto--undoable-change
            4   0% undo-auto--boundary-ensure-timer
           20   0%                                          - widget-copy
           20   0%                                           - widget-apply
           20   0%                                            - 
widget-types-copy
           20   0%                                             - mapcar
           20   0%                                              - 
widget-copy
           20   0%                                               - 
widget-apply
           12   0%                                                - 
widget-types-copy
           12   0% - mapcar
           12   0% - widget-copy
           12 0%                                                   - 
widget-apply
           12 0%                                                    - 
widget-types-copy
           12 0%                                                     - 
mapcar
           12 0%                                                      - 
widget-copy
           12 0%                                                       - 
widget-apply
            8 0%                                                        
- widget-types-copy
            8 0%                                                         
- mapcar
            8 
0%                                                          - widget-copy
            8 0% widget-apply
            4   0% widget-get
         2472   9%                                         - apply
         2472   9%                                          - 
widget-create-child-and-convert
         2468   9%                                           - widget-apply
         2468   9%                                            - 
widget-default-create
         1784   6% delete-char
          336   1%                                             - 
widget-apply
          336   1%                                              - 
widget-push-button-value-create
            8   0%                                               - 
substitute-command-keys
            4   0% buffer-string
           12   0%                                             - 
widget-specify-button
            8   0%                                              - 
widget-apply
            8   0%                                               - 
widget-default-mouse-face-get
            8   0%                                                - 
widget-apply
            8   0% - widget-default-mouse-face-get
            8   0% - widget-apply
            4 0%                                                   - 
widget-default-mouse-face-get
            4 0%                                                    - 
widget-apply
            4 0%                                                     - 
widget-default-mouse-face-get
            4 0% widget-get
            4   0% widget-get
            4   0% re-search-forward
            4   0% widget-get
          932   3% delete-char
          152   0% insert-char
           16   0%                                        - 
widget-match-inline
           16   0%                                         - widget-apply
            8   0%                                          - 
widget-group-match
            8   0%                                           - 
widget-group-match-inline
            4   0%                                            - 
widget-match-inline
            4   0% widget-apply
            8   0%                                          - 
widget-editable-list-match
            8   0%                                           - 
widget-editable-list-match-inline
            8   0%                                            - 
widget-match-inline
            8   0%                                             - 
widget-apply
            8   0%                                              - 
widget-group-match
            8   0%                                               - 
widget-group-match-inline
            8   0%                                                - 
widget-match-inline
            8   0% - widget-apply
            8   0% - widget-checklist-match-inline
            4 0%                                                   - 
widget-match-inline
            4 0%                                                    - 
widget-inline-p
            4 0%                                                     - 
widget-apply
            4 0%                                                      - 
widget-choice-inline-bubbles-p
            4 0% widget-get
            4 0%                                                   - 
widget-checklist-match-up
            4 0%                                                    - 
widget-match-inline
            4 0%                                                     - 
widget-apply
            4 0%                                                      - 
widget-choice-match
            4 0%                                                       - 
widget-apply
            4 0% widget-restricted-sexp-match
          388   1% widget-field-value-create
          124   0%                                       - 
widget-editable-list-format-handler
          116   0%                                        - apply
          116   0%                                         - 
widget-create-child-and-convert
          116   0%                                          - widget-apply
          116   0%                                           - 
widget-default-create
           96   0% delete-char
           20   0%                                            - widget-apply
           20   0% widget-push-button-value-create
            8   0% insert-char
          264   1% delete-char
            4   0%                                      - 
widget-specify-sample
            4   0% widget-apply
            4   0%                                      - 
undo-auto--undoable-change
            4   0% undo-auto--boundary-ensure-timer
            4   0%                                      - 
substitute-command-keys
            4   0%                                       - #<compiled 
-0x1c8e77201f7fa59f>
            4   0%                                        - kill-buffer
            4   0%                                         - 
replace-buffer-in-windows
            4   0%                                          - 
unrecord-window-buffer
            4   0% window-prev-buffers
           12   0%                                     insert-char
            4   0%                                   delete-char
           92   0%                              - apply
           92   0%                               - 
widget-create-child-and-convert
           92   0%                                - widget-apply
           92   0%                                 - widget-default-create
           64   0%                                    delete-char
           16   0%                                  - widget-apply
           16   0% widget-push-button-value-create
           40   0%                                delete-char
            4   0% custom-magic-value-create
            8   0%                   - 
widget-add-documentation-string-button
            8   0%                    - apply
            8   0%                     - widget-create-child-and-convert
            8   0%                      - widget-apply
            8   0%                       - widget-default-create
            4   0%                          delete-char
            4   0%                        - widget-apply
            4   0% widget-documentation-string-value-create
            4   0%                   - custom-add-parent-links
            4   0%                    - mapatoms
            4   0%                     - #<compiled 0x2608cc6bf83bc8>
            4   0%                      - widget-create-child-and-convert
            4   0%                       - widget-apply
            4   0%                        - widget-default-create
            4   0%                           delete-char
           16   0%             - #<compiled -0xf2f5b00c7bd4f2d>
           16   0%              - widget-apply
           16   0%               - widget-default-value-inline
           16   0%                - widget-value
           16   0%                 - widget-apply
           16   0%                  - widget-editable-list-value-get
           16   0%                   - mapcar
           16   0%                    - #<compiled -0xf2f5b00c7bd4f2d>
           16   0%                     - widget-apply
           16   0%                      - widget-default-value-inline
           16   0%                       - widget-value
           16   0%                        - widget-apply
            8   0%                         - widget-editable-list-value-get
            8   0%                          - mapcar
            8   0%                           - #<compiled 
-0xf2f5b00c7bd4f2d>
            8   0%                            - widget-apply
            8   0%                             - widget-default-value-inline
            8   0%                              - widget-value
            8   0%                               - widget-apply
            8   0%                                - 
widget-editable-list-value-get
            8   0%                                 - mapcar
            4   0%                                  - #<compiled 
-0xf2f5b00c7bd4f2d>
            4   0%                                   - widget-apply
            4   0%                                    - 
widget-default-value-inline
            4   0%                                       widget-get
            8   0%                         - widget-checklist-value-get
            4   0%                          - widget-apply
            4   0%                           - widget-child-value-inline
            4   0%                            - widget-apply
            4   0%                             - widget-default-value-inline
            4   0%                              - widget-value
            4   0%                                 widget-apply
            4   0%                          - widget-value
            4   0%                             widget-apply
          368   1%              widget-setup
            8   0%            - mapc
            8   0%             - custom-magic-reset
            8   0%              - widget-value-set
            8   0%               - widget-apply
            8   0%                - widget-default-value-set
            8   0%                 - widget-apply
            4   0%                  - widget-default-delete
            4   0%                   - widget-apply
            4   0%                    - widget-children-value-delete
            4   0%                     - mapc
            4   0%                      - widget-delete
            4   0%                       - widget-apply
            4   0%                          widget-default-delete
            4   0%                  - widget-default-create
            4   0%                   - widget-apply
            4   0%                    - custom-magic-value-create
            4   0%                     - widget-create-child-and-convert
            4   0%                      - widget-apply
            4   0%                       - widget-default-create
            4   0%                          delete-char
            8   0%          - byte-code
            8   0%           - require
            8   0%            - load-with-code-conversion
            8   0%             - eval-buffer
            8   0%                read
            4   0%            read
            4   0%         - profiler-stop
            4   0%            profiler-cpu-log
          635   2%   Automatic GC
            4   0% - ...
            4   0%  - widget-types-convert-widget
            4   0%   - mapcar
            4   0%    - widget-convert
            4   0%     - widget-types-convert-widget
            4   0%      - mapcar
            4   0%       - widget-convert
            4   0%        - widget-types-convert-widget
            4   0%         - mapcar
            4   0%          - widget-convert
            4   0%           - widget-types-convert-widget
            4   0%            - mapcar
            4   0%             - widget-convert
            4   0%              - widget-apply
            4   0%               - #<compiled 0x66e1b40451af649>
            4   0%                - widget-sexp-value-to-internal
            4   0%                   pp-to-string