adobe / uxp-optimized

Repository for uxp optimized react and javascript components.
MIT License
15 stars 7 forks source link

Profile performance on 10000 random colors list #6

Open krisnye opened 4 years ago

krisnye commented 4 years ago

Visible performance degradation. Profile on a virtual list with large N and identify areas to optimize.

krisnye commented 4 years ago

The most practical approach I’ve come up with is this: Maintain two lists for items: Normal Items = All items with size <= visible window size Large Items = Everything else Sort Normal Items (whenever their rects may have changed). Then to find visible: binary search to visible window area and then check for anything intersecting up to a full window above and/or beneath the visible window. Then check every large item for visibility. This would be O page-size + O large-items