Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let extra_syntaxes_and_themes reference builtin syntaxes #2738

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

9999years
Copy link

Closes #1607
Closes #1678

This lets syntax definitions in extra_syntaxes_and_themes reference builtin syntaxes (by scope: or include: or similar).

Unfortunately, re-building the SyntaxSet is rather expensive. On my (small) personal website, this makes Zola render my site in 469ms rather than 63ms — a slowdown of nearly 8x!

We could potentially mitigate this by serializing the computed SyntaxSet to a file, for example with a cached::DiskCache, but I don't see existing caching infrastructure so I'm not sure if that's a good tradeoff.

Is this wanted? The performance cost is not worth it with the current implementation, but maybe we can optimize it?


  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Code changes

(Delete or ignore this section for documentation changes)

  • Are you doing the PR on the next branch?

If the change is a new feature or adding to/changing an existing one:

  • Have you created/updated the relevant documentation page(s)?

@Keats
Copy link
Collaborator

Keats commented Dec 18, 2024

That's a huge slowdown. Let's see if someone from syntect can weight in because that's too much IMO

@9999years
Copy link
Author

@Keats Yeah, agreed. I opened an issue upstream, we'll see what they think: trishume/syntect#562

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.

Extra syntaxes embedding built-in syntaxes fail Using embedding in custom sublime syntaxes causes panic
2 participants