Skip to content

perf: cache lexers per file extension in syntax highlighting#906

Merged
dgageot merged 1 commit intodocker:mainfrom
rumpl:lexer-cache
Nov 23, 2025
Merged

perf: cache lexers per file extension in syntax highlighting#906
dgageot merged 1 commit intodocker:mainfrom
rumpl:lexer-cache

Conversation

@rumpl
Copy link
Copy Markdown
Member

@rumpl rumpl commented Nov 22, 2025

Previously, the syntaxHighlight function called lexers.Match() for every line in a diff, which is inefficient. This change introduces a thread-safe cache that stores lexers by file extension.

Previously, the syntaxHighlight function called lexers.Match() for every
line in a diff.
This change introduces a thread-safe cache that stores lexers by file
extension.

Assisted-By: cagent
@rumpl rumpl requested a review from a team as a code owner November 22, 2025 18:39
@dgageot dgageot merged commit 692256e into docker:main Nov 23, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants