Here are the tests when using the the latest cvs gdb that yields a gdb output file of about 800k.

Without gdb-get-source-file-list override: ~139s
With gdb-get-source-file-list override: ~125s

Thus it is clear that most of the time is taken just reading the string into emacs. But doing find-file on the same file is almost instantaneous.

Regards,
Dov


On Thu, May 10, 2012 at 5:13 PM, Chong Yidong <cyd@gnu.org> wrote:
Dov Grobgeld <dov.grobgeld@gmail.com> writes:

> Still, it bothering me the fact that the above perl expression parses
> the gdb output in a fraction of a second, (0.01s user time) whereas
> gdb-mi.el takes more than 40s.

I would also like to learn more about where the bottleneck is.

Could you do the following:

M-: (require 'gdb-mi) RET
M-: (defun gdb-get-source-file-list () nil) RET

then run M-x gdb as usual, and see if that makes any difference in
performance?  Leave gdb-create-source-file-list set at t.

(The above steps cause gdb-mi to issue the -file-list-exec-source-files
command and read the output, as usual, but skip parsing the output into
the source file list.)