in reply to Re^3: Macro in perl code?
in thread Macro in perl code?

What is interesting is that the code that you benchmarked and the code that I benchmarked, doesn't actually supply arguments to the either function, which really is the point after all.

Changing the cmpthese call to;

cmpthese(100_000, { shift => sub { foo(1, "foo") }, inline => sub { bar(1, "bar") } });

The results are the same for either method;

bruce:0:~/tmp $ ./535237.pl Rate shift inline shift 15456/s -- -0% inline 15528/s 0% --