Problem
Currently, computeVisibleColumnWindow in lib/features/main_screen/result_grid_view.dart uses an O(C) linear search (while loop) to find the first and last visible columns based on scroll offset. For tables with a massive number of columns (e.g. 3,000+), this loop runs thousands of times per scroll frame (60Hz), causing UI jank.
Solution
Since columnOffsets is a strictly monotonically increasing array of prefix sums, we should replace the linear search with a Binary Search (O(log C)), which will reduce the iterations to roughly ~12 per frame even for huge tables.
Problem
Currently,
computeVisibleColumnWindowinlib/features/main_screen/result_grid_view.dartuses an O(C) linear search (whileloop) to find the first and last visible columns based on scroll offset. For tables with a massive number of columns (e.g. 3,000+), this loop runs thousands of times per scroll frame (60Hz), causing UI jank.Solution
Since
columnOffsetsis a strictly monotonically increasing array of prefix sums, we should replace the linear search with a Binary Search (O(log C)), which will reduce the iterations to roughly ~12 per frame even for huge tables.