You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Neeme Vool <ne...@codewiser.com> on 2001/11/01 16:41:26 UTC

Expensiveness in embperl subs

Hi!

Which is more expensive (memory and processing time)

I want to use some functions on two pages, but one, say A is very rarely
executed, B is very heavily. Is it better to have embperl subs in B and use
them in A throught Execute with import=>1 or put subs into C and import to
both?
Or write instead real perl module and return only processing result for
[+Mymodule::sub( args )+] ?

Neeme

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Expensiveness in embperl subs

Posted by Gerald Richter <ri...@ecos.de>.
Hi!
>
> Which is more expensive (memory and processing time)
>

There is no (real) difference in memory usage

> I want to use some functions on two pages, but one, say A is very rarely
> executed, B is very heavily. Is it better to have embperl subs in B and
use
> them in A throught Execute with import=>1 or put subs into C and import to
> both?

For 1.3 having subs in B will be faster, for 2.0 ist doesn't matter (as long
as the Execute import =>1 is in a [! !] block). You can get the same result
with 1.3 as having the subs in B (and as in 2.0) when you set the
optKeepSourceInMemory for C (but reloading when C changes may not work
correctly)

> Or write instead real perl module and return only processing result for
> [+Mymodule::sub( args )+] ?
>

Basicly, haveing many [+ +] blocks is a little smaller then doing everything
with one [+ +] block, but having literal HTML is faster then a [+ +] block,
so basicly it depends on how your output isstructured. From the executing
time it doesn't make a difference if you call a Embperl sub or a Perl sub.

Gerald

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org