Skip to content

bench(results): measure the dataset consumers; decision for #1549 - #1720

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
perf/columnar-results-1549
Oct 18, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
perf/columnar-results-1549

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Closes #1549

The issue asked to measure first. benchmark/result_consumers_bench.dart (flutter test benchmark/result_consumers_bench.dart, headless) runs sort, filter and CSV export over a 50,000 x 20 CompactResultDataset (6 int, 4 double, 10 string columns) once through asLazyRowList() and once through a List<List<String>> built from it. Median of 5 after a warm-up, two runs:

consumer materialized lazy
sort, int column 24-26 ms 24-27 ms
sort, double column 23-25 ms 25-30 ms
sort, string column 181-182 ms 162-171 ms
filter c0 > 5000 6-7 ms 2-6 ms
filter, free text 45-50 ms 85-90 ms
CSV export 102-112 ms 132-133 ms

Decision: keep List<List<String>> at the consumer boundary. The lazy rows cost nothing for sort and typed filters, and 25-40 ms more for a free-text filter and the export, which run once per user action. Moving them to typed accessors would rewrite the sorter, the filter engine and the exporters for that, and the app already holds only the columnar dataset (the 68.6 -> 17.5 MiB figure of the issue is what a run keeps).

Scope item 3, where the dataset is copied to strings today:

  • DataGridStagingBuffer copies rows.map(List.unmodifiable), but it is built for table-browser pages and table edits, not for SQL result sets (those stay lazy).
  • Sorting returns lazy row wrappers (one small object per row), not strings.
  • The isolate hand-off of a sort or filter sends the dataset's typed lists, not strings; checked with a dataset that has a generic column with a formatter closure (it sorts in the isolate).

Memory is not measured by this bench (RSS in the test runner is too noisy); the issue's AOT numbers stand.

… materialized strings; consumers keep List<List<String>> (#1549)
@github-actions github-actions Bot added enhancement New feature or request performance Theme parser epic label: performance core Core library logic and services data-grid Interactive data grid, cell editor, filtering, groupings P3 Low priority / Polish & Enhancements labels Oct 18, 2026
@github-actions github-actions Bot added this to the 0.5.0 milestone Oct 18, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 16ff66b into dev Oct 18, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core library logic and services data-grid Interactive data grid, cell editor, filtering, groupings enhancement New feature or request P3 Low priority / Polish & Enhancements performance Theme parser epic label: performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant