Skip to content

Conversation

@emrox
Copy link

@emrox emrox commented Jan 23, 2013

{{ '{'message': 'this should work now', 'foo': {'bar':'rab'}}' }}

@nickpearson
Copy link
Contributor

+1 for this

@emrox
Copy link
Author

emrox commented Jan 24, 2013

addition: closing double brackets are allowed in variables.

@emrox
Copy link
Author

emrox commented Jan 24, 2013

oh, the build failed. but i don't care because ruby 1.8.* is just supported until summer 2013
(the 1.9.* build is fine)

@Soleone
Copy link
Member

Soleone commented Jan 24, 2013

hey! could you clarify what the use case of this is for an end user? i currently don't understand why you would need quotes or curly braces in variables names. thanks!

@emrox
Copy link
Author

emrox commented Jan 24, 2013

i'm writing a i18n filter for a project where i have to pass multiple (named) arguments (pluralization, maybe other variables) and my idea was to pass these variables as json-string.
it would look like this:

{{ 'translation_string' | t:'{\'count\':10,\'custom_var\':\'hello world\'}' }}

@phoet
Copy link
Contributor

phoet commented Jun 4, 2013

if there is a programmatic way of creating the translation values (i hope nobody should write JSON in the templates!) you could bypass the whole parsing issue by encoding the json with base46 like so:

require "base64"
require "json"
encoded = Base64.encode64(JSON.dump({'count' => 10, 'custom_var' => 'hello world'})).chomp
# => "eyJjb3VudCI6MTAsImN1c3RvbV92YXIiOiJoZWxsbyB3b3JsZCJ9"
JSON.parse(Base64.decode64(encoded))
# => {"count"=>10, "custom_var"=>"hello world"}

Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this testing the same thing as the previous test? Why do we need the previous one?

@fw42
Copy link
Contributor

fw42 commented Jun 18, 2013

Can we get a performance benchmark for this?

@nickpearson
Copy link
Contributor

I noticed VariableIncompleteEnd has been there since the beginning, but I'm not sure what its purpose is. Is it safe to remove it as is done in this commit? (It seems safe to me -- just wanting to make sure.)

@emrox
Copy link
Author

emrox commented Jun 19, 2013

@fw42 i will run one in the next days
@nickpearson i have no idea what VariableIncompleteEnd does. There are no tests for this and no other signs what it does. I see it as a workaround for messy user codes

@nickpearson
Copy link
Contributor

@emrox I agree. I tested closing an output segment with a single } instead of }} and got a Liquid::SyntaxError. From briefly scanning the code, it appears that the forgiving VariableIncompleteEnd is used when parsing a template, but VariableEnd is used when getting the value of a variable in an output segment (it's used in ContentOfVariable.

Liquid::Template.parse('hi {{ name }').render('name' => 'Joe')
# Liquid::SyntaxError: Variable '{{ name }' was not properly terminated with regexp: /\}\}/

So, as I understand it, the invalid template is being parsed but is not being processed. I would say it's safe to remove VariableIncompleteEnd as long as it's not there for some reason other than sloppy Liquid code that isn't going to work anyway.

@dylanahsmith
Copy link
Contributor

VariableIncompleteEnd appears to be present to be forgiving for when a variable isn't closed properly. We would like liquid to be backwards compatible so that existing liquid templates don't break, so I don't think it should be removed.

Regardless, it is outside the scope of this pull request. A pull request should only address a single issue.

@fw42
Copy link
Contributor

fw42 commented Jun 20, 2013

I would like to get this into 2.6, but we also want 2.6 to be (the last release which is) Ruby 1.8 compatible. Can you fix the broken 1.8 tests?

@emrox
Copy link
Author

emrox commented Jun 21, 2013

Benchmarks with ruby 2.0.0-p195 @fw42

Original

Rehearsal ------------------------------------------------
parse:         4.090000   0.000000   4.090000 (  4.101179)
parse & run:   9.680000   0.010000   9.690000 (  9.732545)
-------------------------------------- total: 13.780000sec

                   user     system      total        real
parse:         4.250000   0.000000   4.250000 (  4.269260)
parse & run:   9.700000   0.020000   9.720000 (  9.752745)

With Patch

Rehearsal ------------------------------------------------
parse:         4.590000   0.000000   4.590000 (  4.612276)
parse & run:   9.760000   0.010000   9.770000 (  9.805729)
-------------------------------------- total: 14.360000sec

                   user     system      total        real
parse:         4.740000   0.000000   4.740000 (  4.757110)
parse & run:   9.810000   0.000000   9.810000 (  9.849854)

@emrox
Copy link
Author

emrox commented Jun 21, 2013

i have no problems running the tests on 1.8.7

$ rvm use 1.8.7
Using /home/stefan/.rvm/gems/ruby-1.8.7-p358
$ ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [x86_64-linux]
$ rake test
Couldn't load ruby-debug. gem install ruby-debug if you need it.
Run options: 

# Running tests:

.....................................................................................................................................................................................................................................................................................................................

Finished tests in 0.078762s, 3923.2248 tests/s, 9789.0171 assertions/s.

309 tests, 771 assertions, 0 failures, 0 errors, 0 skips

i found no way to restart the test on travis ci without recommiting, so it will restarted when i implemented the new test mentioned in #213

@fw42
Copy link
Contributor

fw42 commented Jun 21, 2013

flo@flombp ~/Projects/shopify/liquid [emrox-master] $ rbenv local 1.8.7-p371
flo@flombp ~/Projects/shopify/liquid [emrox-master] $ rake
Couldn't load ruby-debug. gem install ruby-debug if you need it.
Loaded suite /opt/boxen/rbenv/versions/1.8.7-p371/lib/ruby/gems/1.8/gems/rake-10.0.4/lib/rake/rake_test_loader
Started
EE.EEEEEEEEEE............................................E.........EEEEEEEEEE.EEEEEEEEFF.FFF..EE............EEE
EEEEEEEEEEEEEEEEEEEEEEEEFFEEEEEEEEEEEEE..EEEEEEEEEEEEEFEE.....EEEEEEEEEEEFF.
E...EFFEEEE........EEEEEEE.E.....EEEEEEEEE.....EE...EEEEEE.E.EEEEEEEEEEEEEE.EE.EEEEEEEE
EEEEEEEEEE.....EEEEEEEEEEE.EF.FEEEEEEEEEEEE.............
Finished in 0.074958 seconds.

...

@fw42
Copy link
Contributor

fw42 commented Jun 21, 2013

Same with p358 for me

@fw42
Copy link
Contributor

fw42 commented Jun 21, 2013

I get similar numbers:

Before:

Rehearsal ------------------------------------------------
parse:         8.010000   0.050000   8.060000 (  8.091040)
parse & run:  18.760000   0.070000  18.830000 ( 18.897468)
-------------------------------------- total: 26.890000sec

                   user     system      total        real
parse:         7.710000   0.030000   7.740000 (  7.772535)
parse & run:  18.910000   0.060000  18.970000 ( 19.103792)

Rehearsal ------------------------------------------------
parse:         7.280000   0.040000   7.320000 (  7.328285)
parse & run:  17.590000   0.050000  17.640000 ( 17.647598)
-------------------------------------- total: 24.960000sec

                   user     system      total        real
parse:         7.390000   0.030000   7.420000 (  7.426774)
parse & run:  17.970000   0.050000  18.020000 ( 18.041337)

After:

Rehearsal ------------------------------------------------
parse:         7.980000   0.050000   8.030000 (  8.033731)
parse & run:  19.810000   0.080000  19.890000 ( 20.070070)
-------------------------------------- total: 27.920000sec

                   user     system      total        real
parse:         8.750000   0.030000   8.780000 (  8.842878)
parse & run:  19.780000   0.060000  19.840000 ( 19.909235)

Rehearsal ------------------------------------------------
parse:         8.330000   0.060000   8.390000 (  8.409462)
parse & run:  18.370000   0.060000  18.430000 ( 18.428859)
-------------------------------------- total: 26.820000sec

                   user     system      total        real
parse:         8.000000   0.040000   8.040000 (  8.041571)
parse & run:  18.710000   0.050000  18.760000 ( 18.777811)

@boourns, big deal?

@ghost ghost assigned trishume Aug 6, 2013
@fw42
Copy link
Contributor

fw42 commented Aug 30, 2013

@emrox, any progress (or interest) in fixing the broken tests?

@emrox
Copy link
Author

emrox commented Aug 31, 2013

no progress atm, but still interested in fixing these tests.
i try to find a useable 1.8 env in the next week and try to fix it

@bogdan
Copy link
Contributor

bogdan commented Sep 3, 2013

+1 for this

@emrox
Copy link
Author

emrox commented Sep 3, 2013

Just a note to myself (and any one interested): the problem is in liquid.rb PartialTemplateParser

/#{TagStart}(?:#{QuotedString}|.*?)*#{TagEnd}|#{VariableStart}(?:#{QuotedString}|.*?)*#{VariableEnd}/o

when you remove the * on the groups, everything is fine, but one test where it is needed is failing. Unfortunately it's the test why i created this patch ..

/#{TagStart}(?:#{QuotedString}|.*?)#{TagEnd}|#{VariableStart}(?:#{QuotedString}|.*?)#{VariableEnd}/o

i'm still looking for a solution, thats just the state where i'm stuck atm.

@emrox
Copy link
Author

emrox commented Sep 8, 2013

finaly i'm stuck. i can't see any easy way to fix this in 1.8.7 using regexp. for me it seems like a flaw in the regexp engine of 1.8.7.
so my suggestion is skip this patch for this (last 1.8.7) version and include it in the next version without supporting 1.8.7

@fw42
Copy link
Contributor

fw42 commented Sep 9, 2013

Ok, that's fine with me, thanks for the effort @emrox!

@fw42
Copy link
Contributor

fw42 commented Jan 7, 2014

@emrox: Can you rebase against master and see if tests pass? (We dropped 1.8 support and removed it from CI).

@fw42
Copy link
Contributor

fw42 commented Jul 23, 2014

I'm closing this, since there is no progress for almost a year and it doesn't pass tests anymore on current master (just tried it). Please reopen if you are still interested in getting this merged.

@fw42 fw42 closed this Jul 23, 2014
@bogdan
Copy link
Contributor

bogdan commented Jul 23, 2014

I am still interested in this one. I can finalize this request if there are concerns.

@fw42
Copy link
Contributor

fw42 commented Jul 23, 2014

No concerns, if you can make a PR with green tests, we can run a performance benchmark again.

@fw42
Copy link
Contributor

fw42 commented Jul 23, 2014

This is the failing tests that I get (on Ruby 2.1.2):

-- LAX ERROR MODE
Run options:

# Running tests:

[258/432] ParsingQuirksTest#test_variables_containing_double_curly_bracket = 0.00 s
  1) Failure:
ParsingQuirksTest#test_variables_containing_double_curly_bracket [/home/vagrant/src/liquid/test/integration/parsing_quirks_test.rb:116]:
Exception raised:
<#<Liquid::SyntaxError: Unexpected character \ in "{{ '{{fancy{{\'user\'}}name}}' | remove:'{{just{{CurlyBrackets}}Again}}' }}">>.

[260/432] ParsingQuirksTest#test_variables_with_escaped_quotes = 0.00 s
  2) Error:
ParsingQuirksTest#test_variables_with_escaped_quotes:
Liquid::SyntaxError: Unexpected character " in "{{ "test \" escaping" }}"
    /home/vagrant/src/liquid/lib/liquid/lexer.rb:42:in `tokenize'
    /home/vagrant/src/liquid/lib/liquid/parser.rb:5:in `initialize'
    /home/vagrant/src/liquid/lib/liquid/variable.rb:63:in `new'
    /home/vagrant/src/liquid/lib/liquid/variable.rb:63:in `strict_parse'
    /home/vagrant/src/liquid/lib/liquid/variable.rb:24:in `initialize'
    /home/vagrant/src/liquid/lib/liquid/block.rb:105:in `new'
    /home/vagrant/src/liquid/lib/liquid/block.rb:105:in `block in create_variable'
    /home/vagrant/src/liquid/lib/liquid/block.rb:104:in `scan'
    /home/vagrant/src/liquid/lib/liquid/block.rb:104:in `create_variable'
    /home/vagrant/src/liquid/lib/liquid/block.rb:53:in `parse'
    /home/vagrant/src/liquid/lib/liquid/tag.rb:9:in `parse'
    /home/vagrant/src/liquid/lib/liquid/document.rb:5:in `parse'
    /home/vagrant/src/liquid/lib/liquid/template.rb:102:in `parse'
    /home/vagrant/src/liquid/lib/liquid/template.rb:90:in `parse'
    /home/vagrant/src/liquid/test/integration/parsing_quirks_test.rb:125:in `test_variables_with_escaped_quotes'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1265:in `run'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit/testcase.rb:17:in `run'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:940:in `block in _run_suite'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:933:in `map'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:933:in `_run_suite'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:663:in `block in _run_suites'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:661:in `each'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:661:in `_run_suites'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:884:in `_run_anything'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1092:in `run_tests'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1079:in `block in _run'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1078:in `each'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1078:in `_run'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1066:in `run'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:27:in `run'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:780:in `run'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:372:in `block (2 levels) in autorun'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:33:in `run_once'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:371:in `block in autorun'

[261/432] RawTagTest#test_open_tag_in_raw = 0.26 s
  3) Failure:
RawTagTest#test_open_tag_in_raw [/home/vagrant/src/liquid/test/integration/tags/raw_tag_test.rb:23]:
<" Foobar {{ invalid 1"> expected but was
<" Foobar {{ invalid {% endraw %}{{ 1 }}">.

[342/432] StandardTagTest#test_multiline_tag = 0.00 s
  4) Error:
StandardTagTest#test_multiline_tag:
Liquid::SyntaxError: Tag '{%' was not properly terminated with regexp: /\%\}/
    /home/vagrant/src/liquid/lib/liquid/block.rb:50:in `parse'
    /home/vagrant/src/liquid/lib/liquid/tag.rb:9:in `parse'
    /home/vagrant/src/liquid/lib/liquid/document.rb:5:in `parse'
    /home/vagrant/src/liquid/lib/liquid/template.rb:102:in `parse'
    /home/vagrant/src/liquid/lib/liquid/template.rb:90:in `parse'
    /home/vagrant/src/liquid/test/test_helper.rb:30:in `assert_template_result'
    /home/vagrant/src/liquid/test/integration/tags/standard_tag_test.rb:295:in `test_multiline_tag'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1265:in `run'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit/testcase.rb:17:in `run'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:940:in `block in _run_suite'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:933:in `map'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:933:in `_run_suite'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:663:in `block in _run_suites'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:661:in `each'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:661:in `_run_suites'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:884:in `_run_anything'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1092:in `run_tests'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1079:in `block in _run'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1078:in `each'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1078:in `_run'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1066:in `run'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:27:in `run'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:780:in `run'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:372:in `block (2 levels) in autorun'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:33:in `run_once'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:371:in `block in autorun'

[413/432] VariableTest#test_multiline_variable = 0.00 s
  5) Error:
VariableTest#test_multiline_variable:
Liquid::SyntaxError: Variable '{{' was not properly terminated with regexp: /\}\}/
    /home/vagrant/src/liquid/lib/liquid/block.rb:107:in `create_variable'
    /home/vagrant/src/liquid/lib/liquid/block.rb:53:in `parse'
    /home/vagrant/src/liquid/lib/liquid/tag.rb:9:in `parse'
    /home/vagrant/src/liquid/lib/liquid/document.rb:5:in `parse'
    /home/vagrant/src/liquid/lib/liquid/template.rb:102:in `parse'
    /home/vagrant/src/liquid/lib/liquid/template.rb:90:in `parse'
    /home/vagrant/src/liquid/test/integration/variable_test.rb:70:in `test_multiline_variable'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1265:in `run'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit/testcase.rb:17:in `run'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:940:in `block in _run_suite'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:933:in `map'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:933:in `_run_suite'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:663:in `block in _run_suites'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:661:in `each'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:661:in `_run_suites'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:884:in `_run_anything'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1092:in `run_tests'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1079:in `block in _run'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1078:in `each'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1078:in `_run'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1066:in `run'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:27:in `run'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:780:in `run'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:372:in `block (2 levels) in autorun'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:33:in `run_once'
    /usr/lib/shopify-ruby/2.1.2-shopify1/lib/ruby/2.1.0/test/unit.rb:371:in `block in autorun'

Finished tests in 0.595178s, 725.8329 tests/s, 1787.6995 assertions/s.
432 tests, 1064 assertions, 2 failures, 3 errors, 0 skips

@bogdan
Copy link
Contributor

bogdan commented Jul 23, 2014

@fw42 I personally not interested in going in deep as in this PR. All I need is this PR: #251

That solves 100% problems for me and ~90% problems for everyone.

@fw42
Copy link
Contributor

fw42 commented Jul 23, 2014

@bogdan: #251 doesn't pass tests on current master anymore :/

@bogdan
Copy link
Contributor

bogdan commented Jul 23, 2014

@fw42 sure thing I need to fix it, but confirm that you gonna merge it after that.

@fw42
Copy link
Contributor

fw42 commented Jul 23, 2014

I can't promise you that, but I can confirm that we will take another look, do some performance benchmarks, and discuss it again.

@bogdan
Copy link
Contributor

bogdan commented Jul 23, 2014

ok, do you want me to do new PR or you will reopen old one?

@fw42
Copy link
Contributor

fw42 commented Jul 23, 2014

open a new one please

@emrox
Copy link
Author

emrox commented Jul 23, 2014

i fixed it, but need to create a new branch.

@phoet
Copy link
Contributor

phoet commented Jul 23, 2014

@emrox i'm back in hamburg next week, btw

@fw42
Copy link
Contributor

fw42 commented Jul 23, 2014

:-(

@emrox
Copy link
Author

emrox commented Jul 23, 2014

emrox@0912424

should i create a new request?

@phoet \o/

@fw42
Copy link
Contributor

fw42 commented Jul 23, 2014

The test that you removed in that commit was there for a reason... It's a regression test for something that caused troubles in Shopify, see #213 (comment).

@fw42
Copy link
Contributor

fw42 commented Jul 23, 2014

Some more info: @dylanahsmith tried to fix a similar issue in #325, but we had to revert it because it broke certain templates (the relevant part of which was captured in that new regression test). So please don't remove it and make sure it still passes :-)

@emrox
Copy link
Author

emrox commented Jul 23, 2014

@fw42 you are right, i fixed it emrox@c5015dd

benchmark before (original master):

# rake benchmark:run
/.../ruby-2.1.1/bin/ruby ./performance/benchmark.rb lax
Rehearsal ------------------------------------------------
parse:         2.210000   0.000000   2.210000 (  2.212938)
parse & run:   5.290000   0.010000   5.300000 (  5.309140)
--------------------------------------- total: 7.510000sec

                   user     system      total        real
parse:         2.170000   0.000000   2.170000 (  2.182473)
parse & run:   5.280000   0.020000   5.300000 (  5.291176)

benchmark after:

Rehearsal ------------------------------------------------
parse:         2.510000   0.010000   2.520000 (  2.535995)
parse & run:   5.580000   0.010000   5.590000 (  5.629562)
--------------------------------------- total: 8.110000sec

                   user     system      total        real
parse:         2.440000   0.010000   2.450000 (  2.455963)
parse & run:   5.490000   0.010000   5.500000 (  5.501793)

@fw42
Copy link
Contributor

fw42 commented Jul 23, 2014

Hm that's kind of a big hit :-/ Can you open a new PR with all that and I will ping our performance team to discuss

eq19 pushed a commit to VirtualNetworks/liquid that referenced this pull request May 2, 2025
Depending on the context, the value should be 'user'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants