Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!cluster!metro!bunyip!lance!surf!eay From: eay@surf.sics.bu.oz (Eric the Young) Newsgroups: comp.lang.perl Subject: Perl run-time image dumping Message-ID: <903@surf.sics.bu.oz> Date: 20 Mar 90 02:46:28 GMT References: <15230@bfmny0.UU.NET> <15232@bfmny0.UU.NET> <1118@etnibsd.UUCP> <1990Mar16.010322.18464@tc.fluke.COM> <100628@convex.convex.com> Reply-To: eay@surf.sics.bu.oz (Eric the Young) Organization: SICS, Bond University, Australia. Lines: 33 In article <100628@convex.convex.com> tchrist@convex.COM (Tom Christiansen) writes: >In article <1990Mar16.010322.18464@tc.fluke.COM> inc@tc.fluke.COM (Gary Benson) writes: >> 1. It seems that perl scripts are compiled just prior to execution. >> Would there be any benefit to a perl compiler that, like C, would >> JUST do the compilation and create a file (a.out might be a cool name >> or maybe p.out). This way, I could store the executable somewhere and >> not have to recompile each and every time. > >Well, you can compile it, sort of, using the dump operator or the -u >flag. I really love the speedup I get from a dumped perl script, but the >disk space of including all of perl in each one is almost always >prohibitive. I would like perl to dump JUST the dataspace and enough >special text that says to re-invoke itself in a way indicating that it >should load its data from this file. If the time taken during startup is the parsing, surely perl could be made to dump an image of the compiled program (pl-code :-) that could be reloaded very quickly with minimal parsing. If the file was acsii it could still be invoked via #!/bin/perl -pl_code_flag on the first line. A 500 line perl script becomes n lines of semi-random-ascii. How much of a saving this would be I don't know, since I don't have undump and I have not done any profiling on large perl scripts (yet :-) to find out the startup costs. I also don't know how much of the startup time is just spend mallocing variables, etc, etc, so there may be no real saving unless you save an image of the heap. eric (a novice perl hacker) -- Eric Young | I owe, I owe, System Programmer, SICS Bond Uni.| So off to work I go. ACSnet: eay@surf.sics.bu.oz.au |