You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(sqlite): eliminate redundant double string conversion pass in SqliteSqlExecutionDelegate #1354
In lib/features/sqlite/sqlite_sql_workspace.dart (lines 108–114):
final rawRows = results.take(limitCount).map((row) {
return cols
.map((col) =>sqliteResultCellToDisplayString(row[col]))
.toList();
}).toList();
final outRows =awaitconvertResultRowsToStringsAdaptive(rawRows);
rawRows is already converted into a List<List<String>> using sqliteResultCellToDisplayString.
Immediately on line 114, rawRows is passed into convertResultRowsToStringsAdaptive(rawRows).
As explicitly documented in postgres_result_utils.dart (lines 39–42):
"Rows are already strings after this, so callers must not run them through convertResultRowsToStringsAdaptive again: that would walk (and, from 1000 rows, copy to an isolate) the whole matrix a second time without being able to recover any type information."
For SQLite queries returning $\ge 1000$ rows, convertResultRowsToStringsAdaptive copies the entire 2D string matrix to a worker isolate and back, allocating a duplicate matrix of identical strings and doubling the execution CPU cost.
Proposed Solution
Pass raw objects directly to convertResultRowsToStringsAdaptive with a single-pass conversion, or:
Use rawRows directly without calling convertResultRowsToStringsAdaptive a second time (or intern strings during the first pass).
Acceptance Criteria
SQLite query execution performs only a single pass over result rows.
Eliminates isolate serialization/deserialization overhead for SQLite result sets $\ge 1000$ rows.
Displayed grid cells and cell editing remain identical.
Activity
ZhuchkaTriplesix commentedon Oct 11, 2026
Done in #1407 (merged into
dev).