File list performance

Miklos Szigetvari <[email protected]> Sat, 11 Aug 2012 19:30:04 +0200
Newsgroups gmane.comp.debugging.ddd.general
Message-ID <[email protected]>
Hi

I have a very very bad performance during the source file list.
After making a dump, I got the following call stack:
  1 string::operator..(int)
                       +0000002A 
*NAMATH                                                     Call
  2        GDBAgent::strip_control(string&) const
                       +0000057E 
*NAMATH                                                     Call
  3        GDBAgent::ends_with_prompt(const string&)
                       +0000006C 
*NAMATH                                                     Call
  4 GDBAgent::handle_input(string&)
                       +000001DE 
*NAMATH                                                     Call
  5 GDBAgent::InputHP(Agent*,void*,void*)
                       +000000CA 
*NAMATH                                                     Call
  6        HandlerList::call(unsigned int,void* const,void* const) cons
                       +000000C2 
*NAMATH                                                     Call
  7 Agent::callHandlers(int,void*)
                       +00000030 
*NAMATH                                                     Call
  8        LiterateAgent::dispatch(int,const char*,int)
                       +000000FA 
*NAMATH                                                     Call
  9 LiterateAgent::inputReady(AsyncAgent*)
                       +000000A4 
*NAMATH                                                     Call
  10       AsyncAgent::dispatch(int*,unsigned long*)
                       +000000B6 
*NAMATH                                                     Call
  11       AsyncAgent::somethingHappened(void*,int*,unsigned long*)
                       +00000028 
*NAMATH                                                     Call
  12 XtAppProcessEvent
                       +00000226 
*NAMATH                                                     Call
  13 wait_for_gdb_reply(GDBReply*,int)
                       +000000E4 
*NAMATH                                                     Call
  14       gdb_question(const string&,int,bool)
                       +00000242 
*NAMATH                                                     Call
  15       SourceView::read_from_gdb(const string&,long&,bool)
                       +000003E4 
*NAMATH                                                     Call
  16 SourceView::read_indented(string&,long&,SourceOrigin&,bool)
                       +00000998 
*NAMATH                                                     Call
  17 SourceView::read_current(string&,bool,bool)
                       +000001E6 
*NAMATH                                                     Call
  18 SourceView::read_file(string,int,bool,bool)
                       +0000009E 
*NAMATH                                                     Call
  19       SourceView::show_execution_position(const string&,bool,bool,
                       +00000496 
*NAMATH                                                     Call
  20 command_completed(void*)
                       +00000EB6 
*NAMATH                                                     Call
  21 GDBAgent::handle_input(string&)
                       +000007B0 
*NAMATH                                                     Call
  22 GDBAgent::InputHP(Agent*,void*,void*)
                       +000000CA 
*NAMATH                                                     Call
  23       HandlerList::call(unsigned int,void* const,void* const) cons
                       +000000C2 
*NAMATH                                                     Call
  24 Agent::callHandlers(int,void*)
                       +00000030 
*NAMATH                                                     Call
  25       LiterateAgent::dispatch(int,const char*,int)
                       +000000FA 
*NAMATH                                                     Call
  26 LiterateAgent::inputReady(AsyncAgent*)
  27       AsyncAgent::dispatch(int*,unsigned long*)
                       +000000B6 *NAMATH
  28       AsyncAgent::somethingHappened(void*,int*,unsigned long*)
                       +00000028 *NAMATH
  29 DoOtherSources
                       +00000058 *NAMATH
  30 XtAppNextEvent
                       +00000078 *NAMATH
  31 process_next_event()
                       +00000182 *NAMATH
  32 ddd_main_loop()

Seems to me in the source_view the the strip_control function is called 
again and again for the whole chunk, still has listed , and it leads to 
a terrible performance for
a larger file (10 000 lines or more ).
Somebody else has noticed this ? Any way to avoid ?