[haiku-commits] Re: r38589 - haiku/trunk/src/kits/interface

  • From: Clemens <clemens.zeidler@xxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 09 Sep 2010 10:20:17 +1200

On Thu, 09 Sep 2010 10:05:22 +1200, Stephan Assmus <superstippi@xxxxxx> wrote:


I haven't actually tested what is more expensive. I do have a use-case where the string with stays the same, even when the string changes. The string actually changing at all is already tested at the beginning of the function. I suppose calling InvalidateLayout() unchecked is more expensive than using StringWidth() twice, that's why I made the change, but like I said, I haven't actually tested it.

I also think that InvalidateLayout is more expensive but the question is what is the more common? that the string width stay the same or it change and which case we want to optimize...

As long as you are not changing the string to often performance is now problem anyway.

Regards,
        Clemens

Other related posts: