Subject: bug#28704: 27.0.50; Sorting packages list slow when using display-line-numbers-type visual

From: martin rudalics <[email-masked]>
Date: Thu, 05 Oct 2017 10:09:25 +0200

> Then run: M-x list-packages
 >
 > Then click on one of the column headers to trigger sorting by that
 > column, e.g. Status. Emacs will freeze for a couple of minutes.
 >
 > Profiler reveals:
 >
 > - command-execute                                               25144  98%
 >   - call-interactively                                           25144  98%
 >    - funcall-interactively                                       25144  98%
 >     - tabulated-list-col-sort                                    24960  97%
 >      - tabulated-list--sort-by-column-name                       24960  97%
 >       - tabulated-list-print                                     24956  97%
 >        - apply                                                   24916  97%
 >         - tabulated-list-print-entry                             24903  97%
 >          - tabulated-list-line-number-width                      24736  96%
 >             #<compiled 0x2a38871>                                    2   0%
 >
 > So it looks like all of the time is spent inside tabulated-list-line-number-width.

‘tabulated-list-print’ should calculate ‘line-number-display-width’ once
and ‘tabulated-list-line-number-width’ should use that value.

martin