----- Original Message -----
From: "Perl6 RFC Librarian" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, August 29, 2000 10:20 PM
Subject: RFC 172 (v1) Precompiled Perl scripts.
> This and other RFCs are available on the web at
> http://dev.perl.org/rfc/
>
> =head1 TITLE
>
> Precompiled Perl scripts.
>
> =head1 ABSTRACT
>
> The functionality to store/load precompiled perl scripts may be built into
> the core.
You're on the right track. May I make a suggestion. Ok, I'm obviously
biased towards Python. But Larry _did_ say that we were allowed to steal
back from other languages.
The way python works is that in the library tree, it looks for any of the
following:
.py, pyc, and .so.
You can probably guess what's what. If only the .py was found, it
immediately writes out the .pyc when it finishes compiling. This happens
every time (unless it can't write to the directory).
In perl, we already have .pm and .so. They're in different directory trees,
but that's mainly because of architectural differences.. No reason why a
.pmc couldn't be written to the site_perl directory on the fly. The
standard lib should probably generate the .pmc's at install time.
I would make a seperate RFC, but your title is too similar, so I'd rather
coerce you into this line of thinking.
>
> =head1 DESCRIPTION
>
> There exists a possibility to do the thing. One can store compiled perl
> code in file and load it again via B::Bytecode. But the produced file
> is large. The loading time is comparable to compiling the code anew.
> Several simple experiments show that disk i/o times does not affect too
> much - almost all data are in cache. The B extension mechanisms and
> algorithms are too slow. Therefore it is unusable.
Obviously, perl still needs some work on the op-tree storage / retrival
mechanism before this becomes practical.
>
> Why bother? Consider the script that uses xml/xsl. It takes a lot of time
> to get such a script running. And the debugging process becomes harder
> with annoying initialization (every single .pm must be read by OS from
> numeric files and compiled from the very beginning). Another example is
> web server. Why loose CPU time to compile the same scripts?
>
> =head1 IMPLEMENTATION
>
> Perl may have an option to vary the target precompiled format. The format
> affects the generated precompiled file size. User may choose appropriate
> effective format to minimize loading time. It clearly depends on the
> system which runs the script.
>
-Michael