rnystrom/RNTextStatistics — pull request #2 by barrettj (2013-04-30 19:04:40+00:00)
Title: Cache Values

This will cache several frequently used calculations and syllable counts of words.

Syllable counts for words are stored globally in an NSCache which will auto-purge should memory become an issue.

Cached values (clean text, letter/word/sentence counts, and average syllables) are only cached once accessed so memory of strings where these values aren't used shouldn't be impacted. They're cached with associated objects so they'll automatically be released when the string is.

Cached values are ignored for mutable strings.

P.S. I totally understand if you don't want to merge this as it can/will increase memory usage. I did, however, get a very noticeable speed boost; esp. when displaying multiple statistics about a block of text.