Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!ncar!midway!gargoyle!chinet!les From: les@chinet.chi.il.us (Leslie Mikesell) Newsgroups: comp.lang.perl Subject: Re: can we ever compile perl? Message-ID: <1990Dec17.192346.9898@chinet.chi.il.us> Date: 17 Dec 90 19:23:46 GMT References: <1990Dec13.034336.21769@usenet@scion.CS.ORST.EDU> <93725765@bfmny0.BFM.COM> <1990Dec15.161911.27401@NCoast.ORG> Organization: Chinet - Public Access UNIX Lines: 34 In article <1990Dec15.161911.27401@NCoast.ORG> allbery@ncoast.ORG (Brandon S. Allbery KB8JRR) writes: >As quoted from <93725765@bfmny0.BFM.COM> by tneff@bfmny0.BFM.COM (Tom Neff): >+--------------- >| 2. For many of us, it would be enough to be able to make fast-loadable >| "Perl object files," i.e., write all data structures to disk after >| compilation & before execution. The resulting "compiled scripts" >| would run faster because the parsing pass would be eliminated. >| Especially wonderful with large scripts! >+--------------- >I mentioned this to Larry once; he pointed out that Perl's internal structures >aren't particularly easy to save/restore in a portable way. Of course, it >might be possible to write(savefd, etext, sbrk(0) - etext), but this is also >nonportable. A reasonable solution is to not require the saved copy to be portable or even explicitly saved. Instead, add a statement and/or command line option to specify a directory to cache the parsed output allowing the usual expansions of ~/, $HOME, etc. to give a choice between saving in a public-writable directory or making a private copy for each user. Then, if the directory exists and some quick checks establish that the cached copy was written later than the script on a machine with the same variable types, the parsing pass could be skipped. Otherwise a parsed copy would be saved in that directory (if permissions allow) for the new run to use. I think this would be a big help on machines with slow disks and demand paged executables since it would likely avoid the need to page in a lot of the perl program that would otherwise be needed for the compile pass. It might chew up some disk space, but probably nowhere near to the extent that perl -u does, and this way you still get the advantage of shared text when multiple copies of perl are running. Les Mikesell les@chinet.chi.il.us