On Jun 17, 2011, at 00:46, Andreas Grosam wrote: > Given an NSString as input source, what is the fastest method to "feed" the > parser?
As usual, Ken's answer is better than the one I was composing, but I don't think *any* answer is of use to you unless you specify what representation your parser is converting *to*. If it's something that NSString can encode to, then you're probably better off not using your parser. If not, it might be fastest to first convert the string to whatever encoding your parser is itself fastest at parsing. Or, if your parser is very fast for all the encodings it accepts, try using '[NSString fastestEncoding]' to see if it's one that your parser can handle. I'd bet that for very large strings (the only ones you'd care about from a performance perspective, probably) 'fastestEncoding' is almost always UTF-8 or UTF-16, because such strings are statistically likely to have originated in a file in one of those two representations. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com