On Sunday 11 February 2007, Michaël Larouche wrote:
> Le February 11, 2007 14:39, Martijn Klingens a écrit :
> > Hiya,
> >
> > In 3.5 branch, ChatMessagePart::formatStyleKeywords is a pretty expensive
> > method. It's called for every message. But worse, it's called a *LOT*
> > when the style changes, and this happens whenever a buddy icon changes.
> >
> > A changing buddy icon on an open chat with a few hundred KopeteMessages
> > is horribly expensive. formatStyleKeywords is called again for each of
> > them.
> >
> > Callgrinding Kopete I came up with the attached patch. Simple as it is,
> > it already makes the method about 20% faster by killing most calls to the
> > expensive QColor::name() and the conversion from a string to a color.
> >
> > Additionally, replacing QString::arg() with a simple append also saves
> > some cycles.
> >
> > There is one very big fish in there that I am looking at now, but these
> > optimizations should already help. Ok to commit?
> >
> > Any taker for porting to 4.0?
>
> Looks fine for me

Committed, thanks for review.

-- 
Martijn

An expert is a person who has made all the mistakes which can be made in a 
very narrow field.
_______________________________________________
kopete-devel mailing list
kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel

Reply via email to