Ok, back to premature optimization for a second...

I'm using macros quite a bit these days.  It's often
noted that it's more efficient to use PROCESS over INCLUDE due
to the localization of INCLUDE.

IIRC, MACRO only localizes the variables passed in, right?

    my_macro( foo, bar, baz = 123 );

so just foo, bar, and baz are localized?  If that's true, is it also
true then that the overhead of MACRO is much less than using INCLUDE
vs. PROCESS?

Macros, on the other hand must be added to the stash each time
process() is called.  (I have a macros.tt file that gets preprocessed
each time that does that.)  But, I assume just adding a bunch of
pre-compiled subs to the stash is a rather fast operation.

Profiling apps in the past hasn't shown this to be an issue, but I'd
hate to have to come back at some point and change all the macro calls
to INCLUDE or PROCESS (depending on if I need localization).


-- 
Bill Moseley
[EMAIL PROTECTED]


_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to