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

Optimize TextBefore #172

Merged
merged 4 commits into from
Nov 24, 2024
Merged

Optimize TextBefore #172

merged 4 commits into from
Nov 24, 2024

Conversation

sebastienros
Copy link
Owner

Benchmarked with Fluid where it showed to be the issue while looking into SkipWhiteSpace. TextBefore would run the parser then advance 1 character, run it again, until the parser matched. Now if the parser implements ISeekable it will jump directly to the first char that could succeed.

This was important in Fluid since it seeks {% or {{ for a tag start, and would then just run the parse for every single character before that. This results in at least 30% improvement in parsing in Liquid.

@sebastienros sebastienros merged commit 7a63fd6 into main Nov 24, 2024
1 check passed
@sebastienros sebastienros deleted the sebros/optimize branch November 24, 2024 19:41
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.

1 participant