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

Add Liquid::ParseContext#parse_expression for liquid-c node disabling #1333

Merged
merged 1 commit into from Oct 27, 2020

Conversation

dylanahsmith
Copy link
Contributor

Problem

We would like to be able to measure the performance benefit of liquid VM rendering in production by disabling liquid VM compilation at runtime. However, tags are parsing expressions with Liquid::Expression.parse, which doesn't give liquid-c access to the parse context in order to determine whether liquid VM compilation is enabled or not.

Solution

Add Liquid::ParseContext#parse_expression and use it in the liquid tags to parse expressions.

We would like to be able to disable liquid-c VM rendering at runtime,
but right now expresion parsing is done using Expression.parse, which
isn't aware of the parse context.  That prevents us from conditionally
compiling to VM code based on a parse option.
Copy link
Contributor

@macournoyer macournoyer left a comment

Choose a reason for hiding this comment

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

Does this affect profiling too? I guess it's in preparation for Shopify/liquid-c#96.

@dylanahsmith
Copy link
Contributor Author

No, this shouldn't affect profiling. Although, it might help better test that path.

It isn't a blocker for Shopify/liquid-c#96. I've added a comment to that PR (Shopify/liquid-c#96 (comment)) to explain why I haven't merged it yet.

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

3 participants