Haoyu Zhang
bc317e642c
Optimize TextView#populateCharacterBounds
Avoid unnecessary calls of getPrimaryHorizontal/getSecondaryHorizontal,
this will make the method around 2 times faster.
Also avoid repeat calls of isPositionVisible, which reduces the
computation time around 5%.
Before:
populateCharacterBounds[mTextLength (100))]_min (ns): 416685
populateCharacterBounds[mTextLength (300))]_min (ns): 1315209
populateCharacterBounds[mTextLength (1,000))]_min (ns): 4480508
populateCharacterBounds[mTextLength (3,000))]_min (ns): 13526504
populateCharacterBounds[mTextLength (10,000))]_min (ns): 44841361
After:
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.TextViewCursorAnchorInfoPerfTest
Change-Id: I24a470e204e4a2e52f881828c707adfcca21f890
2022-05-26 09:27:32 -07:00
..
2022-03-03 16:07:15 +00:00
2022-03-03 13:38:47 +00:00
2021-07-13 09:52:12 -04:00
2022-02-09 22:25:14 +00:00
2021-07-06 16:12:25 +09:00
2022-02-10 14:52:37 +01:00
2022-04-21 11:56:42 +00:00
2021-07-01 18:07:15 +00:00
2022-04-27 17:11:04 -07:00
2022-04-26 13:22:01 -07:00
2022-01-19 11:13:18 +00:00
2022-02-09 22:25:14 +00:00
2022-02-25 15:56:15 -08:00
2021-06-07 17:56:13 +00:00
2021-07-06 16:12:25 +09:00
2022-04-01 20:09:26 +00:00
2021-06-17 20:39:33 +00:00
2022-04-04 16:02:38 +02:00
2021-07-30 09:14:44 +00:00
2022-04-18 18:36:02 +00:00
2022-02-24 10:28:46 +00:00
2021-11-29 22:27:37 +00:00
2022-02-25 15:56:15 -08:00
2021-10-28 09:45:45 +09:00
2022-02-10 20:09:46 +00:00
2021-11-17 20:01:30 -08:00
2022-02-09 22:25:14 +00:00
2021-06-08 11:17:29 +00:00
2022-05-26 09:27:32 -07:00
2022-03-24 14:55:15 +08:00
2022-02-10 14:52:37 +01:00
2021-12-21 14:11:08 -05:00
2021-06-04 22:50:28 +00:00
2021-06-25 10:33:27 +00:00