Well, it's three years ago, and now it works far better.
-
NSLayoutManager.setTemporaryAttributes(:forCharacterRange:)
is far faster thanNSTextStorage.setAttributes(:range:)
. On My iMac, former took about 2 seconds, and latter took about 17 seconds in optimised build of test suit. -
Anyway, modifying
NSTextStorage
also took 2 seconds when wrapped bybeginEditing
/endEditing
pair. So this performance drop is mainly due to inefficient layout refresh. You will get same performance
The core part of Unicode is Unicode Scalar Value
. This represents core component to build a Unicode text. Also provides most reliable unit to process text data.
Unicode Scalar Value is equal to Code Point
except surrogate pairs.
Code Unit
is a component of each encoding algorithm. Defined differently by the encodings.
Grapheme Cluster
smallest unit to represent human recgonizable symbol.
Hoon H.