Bug 5250788: TextView gets slower as the text length grows
getSpans was called too many times in handleRun. Pre-compute the subset of intersected spans and iterate over a subset of it instead. Moving the instanceof test in getSpans after the other tests also speeds things up a lot. On a text with ~300 words, all with a span attached, getSpans went down from 78% to 14% of the CPU usage. Change-Id: I59bc44f610e9a548e0dcec68b180934da9e5c559
Loading
Please register or sign in to comment