GTK+ performance problem

I had a performance problem and found a work-around. 
I think the GTK gurus should know about this.

Scrolling output of text from a text view window got slower and slower as
amount of text in the buffer increased.

Here is what I was doing after adding each line of text at the end of the

      endMark = gtk_text_buffer_create_mark(textBuff,null,&iter1,0);

After a few thousand lines, the output speed was a tiny fraction of the
initial speed. 

I found an easy solution: save the endMark and avoid the call to
Apparently this function is very slow if the text in the buffer is large
(like > 100 KB).
(Is there a good reason for this?).

After this change, the output speed remains very fast (1000s of lines per
even if the buffer has megabytes of  text.

My GTK+ version is 2.8.20

View this message in context:
Sent from the Gtk+ - Dev - General forum at

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]