> When the actual C code (or ASM equivalent or
> bytecode or whatever Perl uses) for a
> function is run, is there overhead to the
> function?

I'm no internals expert, but I would say yes, there is some overhead.  The
overhead has to deal with pushing aliases of the passed params onto the @_
array and I assume a push onto the call stack.

> Are functions inlined?

No, not that I am aware of.

> Does perl lazy compile functions?

Yes, like Bob mentioned, but it isn't the usual behavior.  Two ways (that I
can think of) to do this are using the Autoload module which will load and
compile functions that are in external files (Some large modules like CGI do
this).  The other way is eval'ing a block of code, using eval(), do(), or
require().

Rob

-----Original Message-----
From: Dan Anderson [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 20, 2003 1:12 PM
To: Perl Beginners
Subject: How does perl compile functions


I'm curious how perl "compiles" functions internally.  When the actual C
code (or ASM equivalent or bytecode or whatever Perl uses) for a
function is run, is there overhead to the function?  Are functions
inlined?  Does perl lazy compile functions?  (i.e. functions never used
are never compiled and that is why errors suddenly pop up when using a
function for the same time).

Thanks in advance from a curious mind,
Dan


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to