commit | 945ee9b1661e60e0074d4f16f61fc147c728c6bf | [log] [tgz] |
---|---|---|
author | Gilles Debunne <debunne@google.com> | Mon Sep 19 19:18:18 2011 -0700 |
committer | Gilles Debunne <debunne@google.com> | Fri Sep 23 11:00:27 2011 -0700 |
tree | c2841c578808aa3653727abab0b6360f378ab0e7 | |
parent | 5840639fd18c334c0df30ae03b270c452fee0a61 [diff] |
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