Skip to content

perf(mysql): add StringInternPool to MySqlSqlExecutionDelegate row conversion #1356

Closed

Description

@ZhuchkaTriplesix

Summary

In lib/features/mysql/mysql_sql_workspace.dart (lines 110–121):

final outRows = [
  for (final row in taken.items)
    List.generate(
      row.numOfColumns,
      (i) => mysqlResultCellToDisplayString(row.colAt(i), column: col),
    ),
];

mysqlResultCellToDisplayString in lib/core/database/mysql_result_cells.dart supports an optional StringInternPool? pool parameter, but MySqlSqlExecutionDelegate never passes a pool.
Unlike PostgreSQL (which uses StringInternPool via convertPostgresResultRowsToStringsAdaptive), MySQL allocates fresh string instances for every single cell. For large result sets with repetitive status, boolean, foreign key, or category values, this creates tens of thousands of duplicate heap string allocations.

Proposed Solution

  1. Instantiate and pass a StringInternPool during MySQL row generation in MySqlSqlExecutionDelegate.executeQuery.
  2. Yield to the event loop every kResultStringConvertYieldEvery rows during conversion to prevent UI frame hitching.

Acceptance Criteria

  • Identical string cell values across rows in MySQL share interned references.
  • Memory usage during MySQL query execution is measurably reduced.

Activity

  1. added
    performanceTheme parser epic label: performance
    mysqlMySQL database driver and workspace
    backendBackend database driver execution and queries
    P3Low priority / Polish & Enhancements
    on Oct 10, 2026
  2. ZhuchkaTriplesix commented on Oct 11, 2026

    @ZhuchkaTriplesix
    MemberAuthor

    Done in #1410 (merged into dev).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low priority / Polish & EnhancementsbackendBackend database driver execution and queriesmysqlMySQL database driver and workspaceperformanceTheme parser epic label: performance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions