The Artima Developer Community
Sponsored Link

Agile Buzz Forum
ComposedText vs Label

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
ComposedText vs Label Posted: Jul 12, 2004 7:08 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: ComposedText vs Label
Feed Title: Travis Griggs - Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/travis-rss.xml
Feed Description: This TAG Line is Extra
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Travis Griggs - Blog

Advertisement
If you do any of your own widgets, there's a good chance you draw text on the screen. There's this venerable old object called ComposedText(1), that if you're like me, is just kind of the guy that's used a lot.

There's this other object called Label(2). It's for single line Paragraphs (er, ComposedTexts) and it's a lot less more powerful. Realistically, Label's all that I probably need 95% of the time. But habits being what they are, I just tend to grab the powerhouse and forget about it after that.

Here's the thing though. I knew that the extra power of ComposedText comes at a price, but I've never really bothered to care or check at what price. So I took a look at it today. I was shocked at just how much faster Label is:

Class ms to create x 100000
ComposedText 4348
Label 198

That's a factor of nearly 22x! Drawing is also a bit faster.

Class ms to draw x 10000
ComposedText 2050
Label 512

About 8x faster. The morale is: If you don't need the multiline composition capabilities of ComposedText, don't bother with it. Of course, before you worry about it, make it work, and make it right.

(1) I have never understood why they renamed this from the simple and terse "Paragraph" as it was called in the blue book. Which name do you like better?

(2) It's really too bad that there's not a good "name" one can put on a "displayed text "so that we could draw the terms ComposedText and Label closer together.

Read: ComposedText vs Label

Topic: Why things don't always get better Previous Topic   Next Topic Topic: Mission Accomplished

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use