gdb output window performance

Vladimir Prus ghost at cs.msu.su
Wed Apr 12 16:55:07 UTC 2006


Hi,
over on MI branch, I'm rewamping variable tree handling and doing some 
profiling along the way. Surprisingly, it seems like gdb window is the 
slowest part. 

On MI branch, it's possible to select if "internal" commands are logged to gdb 
window, or not. With logging turned off, refetch of variable values after 
step takes something line 100 ms, which is acceptable. With logging turned 
on, refetch takes nearly 600 ms, which is beyond any reasonable expectation.

The logging in implemented in languages/cpp/debugger/gdboutputwidget.cpp as is 
nothing fancy:


   void GDBOutputWidget::showStdout(const char* line)
   {
       if (strncmp(line, "(gdb) ", 5) == 0)
           m_gdbView->append(QString("<font color=\"blue\">")
                            .append( html_escape(line) ).append("</font>") );
       else
          m_gdbView->append( html_escape(line) );
       //    m_gdbView->scrollToBottom();    
   }

The call to 'scrollToBottom' was commented just now, and has no apparanent 
effect on performance. The 'm_gdbView' is QTextEdit. Before I go and write my 
own GdbLogginWidgetImplementedAsQScrollArea, maybe somebody knows any 
possible reason why QTextEdit is that slow?

- Volodya







More information about the KDevelop-devel mailing list