> I'll look into wxTextCtrl::WriteText (that gets called by AppendText
> right after the insertion point is moved to the end) as soon as I have a
> chance.

Ok.
I'm done with tracking.
It's right inside gtk_text_buffer_insert
Postponing the investigation of this due to it's level of difficulty
compared to other matters at hand.
I am 95% sure it's gtk+ problem. What makes me wonder is that google
doesn't seem to know anything about it.
It does all sorts of things inside _gtk_text_btree_insert for some
reason.

Meanwhile Mahogany can be made usable with the text viewer by:

* Making it not process the text twice in some occasions
* Calling wxTextCtrl::AppendText as less as possibly, that is it
shouldn't be called once for each line if lines have the same style
really, but only once per _real_ style change.
With the sample message I was sent should then render at least 50 times
quicker, most probably more.
Without the Quotes and URL filter the message is written with just some
AppendText's. With the filter turned on, at least once per line.
* Alternatively even better instead of the previous point is to write
all and then style it with SetStyle. See below.

Each AppendText call costs some time in milliseconds, starting from zero
and raising gradually when called on a larger buffer. In case of the
sample message I was sent, maxing out at around 90 milliseconds. The
beginning didn't have any URLs, so hundreds of lines were actually
styled the same and could have been appended at once.

Most efficient in gtk2 would be if all the text is inserted at once and
then the styling is done. So basically if you AppendText all at once and
then style it with wxTextCtrl::SetStyle.
Why this is the case when a btree is used is currently beyond me.

But alas, all this is just a work around the deficits of gtk+.
I will construct a smaller code testcase in due course and see if I'm
100% right. Most probably could buffer text writes inside wxTextCtrl
until a style change happens or a timeout occurs, and work around it.
Postponed for now. Knowing myself in priorizing tasks I bet I'll work on
this soon enough, while I should do other things :)

-- 
With regards,
Mart Raudsepp

Project manager of wxMUD
E-mail: [EMAIL PROTECTED]
http://wxmud.sourceforge.net/



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Mahogany-Developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-developers

Reply via email to