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

refactor: Advance tokenizer array offset instead of using Array#shift #1653

Merged
merged 1 commit into from Nov 9, 2022

Conversation

dylanahsmith
Copy link
Contributor

Array#shift would move all the remaining elements of the array, which is slower for larger arrays, such as from larger templates.

Array#shift would move all the remaining elements of the array, which
is slower for larger arrays.
Copy link
Contributor

@ggmichaelgo ggmichaelgo left a comment

Choose a reason for hiding this comment

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

Nice! I have tested with a 3MB Liquid template file, and it has slight improved our parse time: 0.433 i/s => 0.448 i/s

Changes make sense, and LGTM!

@dylanahsmith dylanahsmith merged commit 1cdd1f0 into master Nov 9, 2022
@dylanahsmith dylanahsmith deleted the tokenizer-offset branch November 9, 2022 18:03
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.

None yet

2 participants