Skip to content

feat(theme): LRU cache for parsed themes (#109) - #140

Merged
ZhuchkaTriplesix merged 2 commits into
devfrom
issue/109-theme-registry-cache
Jun 14, 2026
Merged

feat(theme): LRU cache for parsed themes (#109)#140
ZhuchkaTriplesix merged 2 commits into
devfrom
issue/109-theme-registry-cache

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Summary

  • Cache QueryaTheme in ThemeRegistryService.loadTheme by definition.stableCacheKey.
  • Private LRU (max 16 entries), clearCache(), and themeParseCount for tests.
  • Content hash changes produce a new cache key; oldest entries evict at capacity.

Test plan

  • flutter test test/core/theme/theme_registry_cache_test.dart
  • flutter test test/core/theme/theme_registry_service_test.dart

Closes #109

Cache parsed QueryaTheme by stableCacheKey with a 16-entry LRU, clearCache for
tests, and themeParseCount to verify cache hits.
@github-actions github-actions Bot added theme Theming, colors, VS Code themes performance Theme parser epic label: performance registry Theme parser epic label: registry labels Jun 14, 2026
@github-actions github-actions Bot added this to the Theme system milestone Jun 14, 2026

@ZhuchkaTriplesix ZhuchkaTriplesix left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

123

@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 9a8d3e4 into dev Jun 14, 2026
3 checks passed
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the issue/109-theme-registry-cache branch June 15, 2026 04:13
ZhuchkaTriplesix added a commit that referenced this pull request Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Theme parser epic label: performance registry Theme parser epic label: registry theme Theming, colors, VS Code themes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant