Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(virtual-scroll): use auditTime instead of sampleTime (angular#13131
) The `CdkVirtualScrollViewport` uses `sampleTime` to collect multiple scroll events into one until the next animation frame. However the `sampleTime` also samples even if there is no new upstream values. Which in this case creates an basically useless requestAnimationFrame callback. A better choice would be the `auditTime` operator, which only schedules the requestAnimationFrame when there is actually a new upstream value. In our case it has the exact same behavior, as from looking at the performance profiler in chrome I found out this: first the scroll event fires, then pending requestAnimationFrame callbacks get called, regardless if they where scheduled in the current or previous frame and then the paint occurs.
- Loading branch information