Skip to content

perf(editor): honor kSyntaxHighlightIsolateThreshold #424

Description

@ZhuchkaTriplesix

Parent

Part of #414

Problem

kSyntaxHighlightIsolateThreshold = 8192 is defined but never consulted. Every debounced edit sends full code + grammarJson + theme JSON through compute, so small buffers pay isolate overhead and large buffers resend grammar/theme repeatedly.

Evidence

  • lib/core/editor/syntax_highlight_isolate.dart (const at top; highlightOffMainThread always compute)
  • lib/core/editor/querya_highlight_controller.dart

Acceptance

  • Buffers below threshold highlight inline (or cheaper path)
  • Above threshold uses isolate; grammar/theme cached on worker when possible
  • No typing jank regression on small SQL editors

Suggested fix

Branch on threshold; cache highlighter/theme on the worker isolate; avoid resending grammar every keystroke.

Metadata

Metadata

Labels

editorCode/SQL editorperformanceTheme parser epic label: performance

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions