Hello!
On Tue, Nov 11, 2014 at 10:06 AM, Dragos Dascalita Haut wrote:
> I'm wondering if there's a significant difference in performance between the
> next 2 lines, in the light that ngx.var.VARIABLE is not so optimal:
>
> set_by_lua $myvar 'return ngx.re.gsub(ngx.arg[1], "source", "replace",
> "ijo") ' $myvar;
> vs
> set_by_lua $myvar 'return ngx.re.gsub(ngx.var.myvar, "source", "replace",
> "ijo") ';
>
For this very case, it should be very similar. Also, it's always best
to benchmark things yourself (and I'd be surprised if you find
measurable differences).
Regards,
-agentzh