Click here to get back home

Delay in program execution

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Delay in program execution Bill H 05-24-2008
Posted by Bill H on May 24, 2008, 6:26 am
Please log in for more thread options
I have a website where I use a shareware store written in Perl that
contains 40+ modules. It runs very fast, but I have noticed over the
years, if I make changes to a module's code and post it, there is a 3
or 4 second delay in its execution the first time I run it, then every
other time it runs with no delay. I know (or believe strongly) perl
compiles the source for running the program, but does it keep this
compiled version around for later use unless you change the code and
then it will compile it again (that is the only reason I can think of
for the delay).

I am not running any mod_perl and this is running on an Apache server
under linux.

Bill H

Posted by Tad J McClellan on May 24, 2008, 11:22 am
Please log in for more thread options


> I know (or believe strongly) perl


Or maybe you simply read the docs about how perl executes?


> compiles the source for running the program,


perldoc perlrun

...
After locating your program, Perl compiles the entire program to an
internal form.


--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher0cmdat/"

Posted by Bill H on May 24, 2008, 3:38 pm
Please log in for more thread options
> > I know (or believe strongly) perl
>
> Or maybe you simply read the docs about how perl executes?
>
> > compiles the source for running the program,
>
> =A0 =A0perldoc perlrun
>
> =A0 =A0 =A0 =A0...
> =A0 =A0 =A0 =A0After locating your program, Perl compiles the entire progr=
am to an
> =A0 =A0 =A0 =A0internal form.
>
> --
> Tad McClellan
> email: perl -le "print scalar reverse qq/moc.noitatibaher0cmdat/"

Thats what I thought - but does it keep the compiled version to use
over and over again till I change the code as it appears to do? If so,
where? If not, then why the delay after I change code, just that 1st
time, then it runs fast again?

Bill H

Posted by A. Sinan Unur on May 24, 2008, 4:45 pm
Please log in for more thread options

[ do *NOT* quote sigs ]

>> > I know (or believe strongly) perl
>>
>> Or maybe you simply read the docs about how perl executes?
>>
>> > compiles the source for running the program,
>>
>>    perldoc perlrun
>>
>>        ...
>>        After locating your program, Perl compiles the entire
>> program to an internal form.
...


> Thats what I thought - but does it keep the compiled version to use
> over and over again till I change the code as it appears to do?

No. (You specified that mod_perl is not involved).

> If not, then why the delay after I change code, just that 1st
> time, then it runs fast again?

Look at line 42.

Sinan

>
> Bill H
>



--
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/

Posted by Peter J. Holzer on May 24, 2008, 5:38 pm
Please log in for more thread options
>> > I know (or believe strongly) perl
>>
>> Or maybe you simply read the docs about how perl executes?
>>
>> > compiles the source for running the program,
>>
>>    perldoc perlrun
>>
>>        ...
>>        After locating your program, Perl compiles the entire program to an
>>        internal form.
>
> Thats what I thought - but does it keep the compiled version to use
> over and over again till I change the code as it appears to do?

No. The soure is compiled each time the program is started (and it
shouldn't take "3 or 4 seconds" unless it is really huge).

You wrote that you don't use mod_perl but you didn't write what you do
use and how you "post" a module. If your perl program is started for
each request (as CGI does), then I don't see any reason for the
bevaviour you observe. But if your perl program runs persistently in the
background (maybe via FastCGI or PPerl) and needs to be restarted after
posting the module, than that's possible.

        hp


Similar ThreadsPosted
Perl and waiting for execution of external program January 19, 2005, 8:14 am
Capturing output - how do I avoid the delay? September 6, 2006, 5:28 am
SIGPIPE delay on open2 exec failure April 15, 2005, 3:24 pm
Remote command execution April 12, 2005, 8:02 am
perl execution speed April 20, 2005, 2:43 pm
dynamic execution of equations July 29, 2005, 3:04 pm
external programm execution not possible... December 29, 2005, 11:15 am
Asynchronous perl execution April 11, 2007, 10:43 am
fork() and script execution afterwards May 31, 2007, 10:38 am
Capturing CPU and other execution Stats March 28, 2008, 12:57 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap