I was going to disagree with you and say that ruby is smart enough not to
instanciate a new heap object if the method is called with a parameter but
```puts RubyVM::InstructionSequence.compile("def
a(b='bad');b;end;a('good');").disasm``` told me i'm wrong :-(

- tobi
CEO Shopify


On Wed, Mar 19, 2014 at 10:28 AM, Arthur Nogueira Neves <
notifications@github.com> wrote:

> In lib/liquid/block.rb:
>
> > @@ -116,9 +116,7 @@ def assert_missing_delimitation!
> >        raise SyntaxError.new(options[:locale].t("errors.syntax.tag_never_closed", :block_name => block_name))
> >      end
> >
> > -    def render_all(list, context)
> > -      output = []
> > -      context.resource_limits[:render_length_current] = 0
> > +    def render_all(list, context, output)
>
> I dont think render_all(list, context, output = "") is a good idea, as
> this method is a hotspot, every call it will instantiate a string, without
> using it.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Shopify/liquid/pull/319/files#r10750982>
> .
>