jyyoung has asked for the wisdom of the Perl Monks concerning the following question:

Our shopping cart web page invokes a huge perl cgi file (4500 lines)and takes around 20 seconds reponse time. Half of the time is perl compile and require time. We try to use B:CC backbone to compile perl into c executable to save some compile time. We are running perl5.6 on VMS-AXP7.21 and web server: OSU/3.8;UCX. Our simple test shows error if we have "use" statement in the perl code. We managed to generate c file from the perl file, but the c file has two kinds major warnings at compile time. One is unreachable code. Another one is uninitialized variable. The executable shows memory access error.
Details:
1) #dumper.pl
use Data::Dumper; print "Hello world\n"; 2) $perl -M"O=CC",-odumper.c dumpler.pl 3) $CC/DECC /INCLUDE=PERL_ROOT:[LIB.VMS_AXP.5_6_0.CORE]/Standard=Relax +ed_ANSI/Prefix=All/Obj=.obj/NoList/NOANSI_ALIA dumper.c
message examples:
lab_644d60: ..^ %CC-I-UNREACH, code can never be executed at label lab_644d60 at line number 21476 in file SYS$SYSDEVICE:[DYWWW.TEST]DUMPER.C;1 MAYBE_TAINT_SASSIGN_SRC(sv); ........^ %CC-W-UNINIT1, The scalar variable "left" is fetched but not initialized. at line number 21415 in file SYS$SYSDEVICE:[DYWWW.TEST]DUMPER.C;1

4>run time error:
!!$ run dumper.exe
%SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual address=0000000000000000, PC=0000000000000000, PS=0000001B %TRACE-F-TRACEBACK, symbolic stack dump follows image module routine line rel PC abs PC 0 0000000000000000 0000000000000000 DUMPER DUMPER main 70561 000000000005B0D0 000000000009B0D0 DUMPER DUMPER __main 0 0000000000000070 0000000000040070

Edit 2001-03-21 by tye to wrap long text

Replies are listed 'Best First'.
Re (tilly) 1: perl to c on VMS
by tilly (Archbishop) on Mar 22, 2001 at 06:17 UTC
    Given the size of Perl byte code, startup times may not improve with trying to precompile. Instead you are better off trying to use a persistent interpreter like mod_perl on Apache does.

    Also if your shopping cart does common things like form database requests, you will find that trying to compile breaks a lot of common assumptions. Objects may be created etc that have open connections. Dump and reload and Perl thinks it has connections but the outside world does not agree. (Things will go downhill from there.)