develooper Front page | perl.perl6.announce.rfc | Postings from September 2000

RFC 338 (v1) shareable bytecode

From:
Perl6 RFC Librarian
Date:
September 28, 2000 17:47
Subject:
RFC 338 (v1) shareable bytecode
Message ID:
20000929004701.3941.qmail@tmtowtdi.perl.org
This and other RFCs are available on the web at
  http://dev.perl.org/rfc/

=head1 TITLE

shareable bytecode

=head1 VERSION

   Maintainer: Stéphane Payrard <stef@francenet.fr>
   Date: 28 Sep 2000
   Mailing List: perl6-internals@perl.org
   Number: 338
   Version: 1
   Status: Developing

=head1 ABSTRACT

perl6 should be designed so that different interpretor instances share
bytecode just like binary executables do with shared libraries.

=head1 DESCRIPTION

perl6 should not behave like xemacs or java where virtual machines do
not share loaded bytecode.

Complex environments have multiple simultaneously active instances of
the perl "virtual machine". These instances must tranparently share
loaded modules bytecode juste like executables do with shared
libraries. Counterexample: modperl needs an explicit strategy to (try
to) ensure sharing: it loads all the modules in the parent server

Sharing bytecoded modules is not enough.  Bytecoded modules must be
bundled. Otherwise the too low granularity will provoke a
multiplication of C<mmap()p>ing which will results in lower
performances. Such a bundle can be called: shared bytecode library.

=head2 A concrete example of shareable bytecode libraries in action

With shareable bytecode one can do CGI-type tasks without the modperl
intellectual overhead and less performance overhead than traditional
CGI that must reload and reinterpret all the code. A CGI execution
will still incur the overhead of fork-execing(), as well of open()ing
and map()ping bytecode files but there will be memory sharing and
no parsing, thanks to shareable bytecodes libraires.

=head1 IMPLEMENTATION

With current perl implementation, bytecode would not need
data-segments because declarations of variables or complex data
structures are just the code that built them.

There are many of the classical shared libraries overhead but with a
twist: we are dealing with bytecode, not machine code. A typical
overhead is that addresses must be relative.  As usual, the overhead
of calculating absolute addresses from relative ones should be more or
less counterbalanced by better use of the cache.


=head1 REFERENCES

The present RFC is an added requirement to byte-compiled modules as
describe by Simon Cozens in RFC 301 "Cache byte-compiled programs and
modules"





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About