[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Is it possible to disable function arguments evaluation?
- From: Rebel Neurofog <rebelneurofog@...>
- Date: Thu, 30 Jun 2011 12:48:28 +0400
> In the debug mode of my project, I did a lot log using print().
> There're many string concats and other calculation in the
> arguments of print func.
> In release mode, I assign the print to:
> function dumb_print() end
> to hide the logs.
> But the arguments for print are still evaluated, is it possible
> to avoid this overhead?
I guess, with something like
function do_something (f)
print (f ())
-- Uncomment for release mode:
-- function do_something () end
do_something (function () return "Error: "..obj.get_error () end)
This technique will enlarge VM's code but execution-time will be minimal