ios - NSMutableString appendString vs appendFormat, which is more efficient? -


given this:

nsstring *innerxml = @"somevalue"; nsmutablestring *xml = [[nsmutablestring alloc] init]; 

which of these faster; not asking readability, subjective:

1.

[xml appendformat:@"<randomelement>%@</randomelement>", innerxml]; 

2.

[xml appendstring:@"<randomelement>"]; [xml appendstring:innerxml]; [xml appendstring:@"</randomelement>"]; 

if curious implementation read source code, available online, see: cfstring.c.

essentially core foundation code available part of opensourceing of darwin kernel.


Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Using jquery append to add option values into a select element not working -

javascript - Restarting Supervisor and effect on FlaskSocketIO -