• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
appending attributed strings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

appending attributed strings


  • Subject: appending attributed strings
  • From: Cryx <email@hidden>
  • Date: Sun, 21 Apr 2002 19:05:26 -0500

It seems that appending attributed strings can be very slow. Here's my situation:

1) If I append a large block of text (~100k) to a scroll view's text container the operation takes a fraction of a second.

2) If I append each line (~3000) individually, the operation takes about 10 seconds.

3) If I appended each line to my own attributed string, then append that resulting string to the container, the results are the same as #2.

The application needs to process the text in a line by line fashion, possibly rewriting some lines, maybe adding or removing lines, so #1 is not a viable approach. I suspect the slowness may be due in part to the appends reallocating the string. Is there a way to provide an initial size hint to a string?

Please don't think I'm being overly pedantic. :) The application in question is an interactive client, and even for small input sets, the latency can easily be detected on a DP800. :(
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Prev by Date: Re: Compile times
  • Next by Date: Re: Using NSSocketPort
  • Previous by thread: Re: Compile times
  • Next by thread: Create an NSTextField Programatically
  • Index(es):
    • Date
    • Thread