Introduce Layout#fillCharacterBounds
Introduce Layout#fillCharacterBounds to compute character bounds faster.
This change makes TextView#populateCharacter 5 times faster.
After:
populateCharacterBounds[mTextLength (100))]_min (ns): 52361
populateCharacterBounds[mTextLength (300))]_min (ns): 148941
populateCharacterBounds[mTextLength (1,000))]_min (ns): 463237
populateCharacterBounds[mTextLength (3,000))]_min (ns): 1388081
populateCharacterBounds[mTextLength (10,000))]_min (ns): 1165867
Before:
populateCharacterBounds[mTextLength (100))]_min (ns): 204065
populateCharacterBounds[mTextLength (300))]_min (ns): 653159
populateCharacterBounds[mTextLength (1,000))]_min (ns): 2184327
populateCharacterBounds[mTextLength (3,000))]_min (ns): 6770318
populateCharacterBounds[mTextLength (10,000))]_min (ns): 22777530
Bug: 233922052
Test: atest android.text.TextViewPopulateCharacterBoundsTest
Test: atest android.text.TextViewCursorAnchorInfoPerfTest
Change-Id: I68a47cf3099b89e0a10604b7706fa7a3dea66d32
Loading
Please register or sign in to comment