Files
react-native/Libraries
Genki Kondo 57d3b9e2ca Modify VirtualizeUtils.elementsThatOverlapOffsets to use binary search
Summary:
elementsThatOverlapOffsets was quite inefficient as it was doing a linear scan over all items without an early out for each input offset.

The number of items can be large, so we'd want to use binary search here.
Before: O(MN), where M is the # offsets and N is the # items
After: O(MlogN)

As a utility method, elementsThatOverlapOffsets should not be responsible for checking that the offsets are in increasing order

'binary-search' dep added via https://www.internalfb.com/intern/wiki/React_Native/Building_Product_Experiences/Third_Party_Packages_(npm)/

Changelog:
[Internal] - Modify VirtualizeUtils.elementsThatOverlapOffsets to use binary search

Reviewed By: javache

Differential Revision: D36292326

fbshipit-source-id: 5f22eb5533b69e2ebe5c1cb34e4f82605838f0a7
2022-05-16 13:14:35 -07:00
..
2022-04-05 12:15:05 -07:00
2022-04-05 12:15:05 -07:00
2022-05-12 20:06:24 -07:00