Cocoanetics/DTLocalizableStringScanner — pull request #2 by tammofreese (2012-01-18 11:42:45+00:00)
Title: More performance tuning

Changes:

- stringByNumberingFormatPlaceholders is now based on using a regular expression. Also, if numbering is not needed because there are less than two format placeholders, the string itself is returned. I don't return a copy because the original code has not done that, however it may be a cleaner solution.

- stringByDecodingUnicodeSequences and stringByReplacingSlashEscapes now both search for a backslash in the string first before decoding/replacing is done. If there is no backslash, a copy of the string is returned. In most cases—at least in Adium which you use for performance tuning—the strings don't contain escape sequences, so all the expensive string construction is not needed.

For Adium 1.4.4, genstrings2 is now at

real	0m0.195s
user	0m0.242s
sys	0m0.032s

For genstrings, I get

real	0m6.980s
user	0m6.809s
sys	0m0.036s