Subject: Re: bug#55636: 27.2; etags performance fix when working with very big TAGS files

From: Eli Zaretskii <[email-masked]>
Date: Thu, 26 May 2022 18:09:41 +0300

> From: WAROQUIERS Philippe <[email-masked]>
> CC: "DE BACKER Jurgen (EXT)" <[email-masked]>,
> 	"[email-masked]" <[email-masked]>, VAN VLIERBERGHE Stef
> 	<[email-masked]>
> Date: Thu, 26 May 2022 14:54:04 +0000
> 
> So, I think the problem is just the size our 4 TAGS files:
> 
> One is about 62 MB, 914_000 lines, of those lines, about 59_000 are file names lines,
> another one  46 MB, 629_000 lines, also 59_000 file names lines.
> 
> We have 2 other smaller TAGS file (8MB and 9MB).
> 
> I have run emacs under valgrind --tool=callgrind.
> 
> valgrind points at expand-file-name eating significant cpu (see attachment).

I'm not sure I understand how to interpret that screenshot.

> I have also used the lisp profiler when loading the TAGS files.
> 
> 
> - call-interactively                                           10141  84%
>   - funcall-interactively                                       10077  84%
>    - find-tag                                                   10069  83%
>     - find-tag-noselect                                         10069  83%
>      - visit-tags-table-buffer                                   9584  79%
>       - tags-table-including                                     9578  79%
>        - tags-table-extend-computed-list                         4327  36%
>         - tags-verify-table                                      3274  27%
>          - apply                                                 3274  27%
>           - ad-Advice-tags-verify-table                          3274  27%

This says that most of the time is spent in tags-table-including.  If
you manually load etags.el (NOT .elc!), and then profile the same
operation, the profile could show in more detail which parts of
tags-table-including takes most of the time, and we can take it from
there.

Thanks.