Skip to main content

Performance Guidelines

FDC supports both local in-memory workflows and adapter-backed query workflows. Performance tuning starts by choosing the correct data path for the size and behavior of the application.

Keep small data local

For small and moderate local collections, use a memory-backed dataset and let filtering, sorting, searching, and aggregates run locally. This keeps the architecture simple and avoids unnecessary request overhead.

Use adapter-backed paging for large sources

For large tables or remote APIs, use paging and advertise only the adapter capabilities that the backend can execute correctly.

paging: const FdcDataPagingOptions(
enabled: true,
pageSize: 100,
requireTotalCount: true,
),

Use infinite mode when the UX should append sequential pages instead of replacing the current page.

Push query work to the source

With adapter-backed paging, filtering, sorting, searching, and aggregates should be executed by the adapter or backend when the capability is enabled. Avoid loading a very large source only to filter it in the UI process.

Keep cell builders lightweight

Custom grid cell builders are called frequently while the viewport changes. Avoid expensive synchronous work, I/O, or object graphs that could have been prepared before rendering.

Prefer small immutable value objects and stable column configuration.

Avoid unnecessary dataset churn

Reuse a dataset instance for one logical data source instead of repeatedly constructing it during widget rebuilds. Open or reload intentionally, and dispose datasets when their owning application scope ends.

Treat aggregates as query work

For paged data, use adapter-backed aggregates rather than calculating totals only from the currently loaded page. Cache invalidation and refresh policy should follow actual data changes, not unrelated UI interactions.

Profile real workflows

Measure the behavior that matters in the application:

  • first open;
  • filtered query latency;
  • page navigation;
  • incremental infinite loading;
  • edit/post/apply latency;
  • large-grid scroll behavior;
  • expensive custom cells.

Optimize after measuring the real path. A small local dataset and a million-row SQLite table need different strategies.