"Craig A. Berry" <[EMAIL PROTECTED]> wrote on 07/11/2005 10:38:34 PM:
> At 6:43 PM -0400 7/11/05, John Malmberg wrote:
>
> >Perl_setup.com is optionally built such that it defines perl_root based
on
> the directory it currently resides in, as a step toward being able to
build a
> binary distribution kit that does not require editing it.
I'd recommend writing a perl script or DCL procedure that does the editing.
At the very least make the relocatable perl_setup.com a non default option
offered by configure.com.
> The problem with creating a smart perl_setup.com is that the
> installperl script, via the install target in
> [.vms]descrip_mms.template, uses it to figure out the target
> installation directory. So if we have a self-locating
> perl_setup.com, we'll just be installing on top of the source
> directory. Probably the right thing to do is rewrite the install
> target so it does not depend on perl_setup.com to know where it's
> installing.
That is not the only problem with a dynamic perl_setup.com, the
other problem is performance. The performance of such a script
will be especially bad on a low physical memory VAX, where someone
has written cgi scripts for example that do not use a perl_root in
the system table. Here is a procedure that illustrates the
performance penalty:
$ maxloop = 10000
$ count = 0
$ time0 = f$time()
$Loop_1:
$ define/trans=conc my_perl_root "$DGA5234:[USERS.PPRYMMER.]"
$ deassign my_perl_root
$ count = count + 1
$ if count .lt. maxloop then goto Loop_1
$ time1 = f$time()
$ write sys$output f$fao("!45AS !AS","Loop 1 with fixed translation string
took ",f$delta_time(time0,time1))
$!
$ count = 0
$ time2 = f$time()
$Loop_2:
$ myproc = f$environment("PROCEDURE")
$ myroot_dev = f$parse(myproc,,,"DEVICE","NO_CONCEAL")
$ myroot_dir = f$parse(myproc,,,"DIRECTORY","NO_CONCEAL")
$ myroot_dir = myroot_dir - "][000000." - "><000000."
$ myroot_dir = myroot_dir - "][000000]" - "><000000>"
$ myroot_dir = myroot_dir - "][" - "><"
$ myroot_dir = myroot_dir - ".]" - ".>" - "[" - "]" - "<" - ">"
$ if f$trnlnm("HP_BUILD_PERL_BIN_KIT","LNM$PROCESS_TABLE") .EQS. ""
$ then
$ define/translation=concealed my_perl_root 'myroot_dev'['myroot_dir'.]
$ endif
$ deassign my_perl_root
$ count = count + 1
$ if count .lt. maxloop then goto Loop_2
$ time3 = f$time()
$ write sys$output f$fao("!45AS !AS","Loop 2 with dynamic translation
string took ",f$delta_time(time2,time3))
Here are some test runs:
$ @ def_bench.com
Loop 1 with fixed translation string took 0 00:00:00.80
Loop 2 with dynamic translation string took 0 00:00:04.80
$ @ def_bench.com
Loop 1 with fixed translation string took 0 00:00:00.84
Loop 2 with dynamic translation string took 0 00:00:05.19
$ @ def_bench.com
Loop 1 with fixed translation string took 0 00:00:00.83
Loop 2 with dynamic translation string took 0 00:00:05.18
$ @ def_bench.com
Loop 1 with fixed translation string took 0 00:00:00.73
Loop 2 with dynamic translation string took 0 00:00:04.21
Over the set of those tests the definition and deassignment for the
dynamic generated translation took on average 6.0467 times longer
to execute. Such a performance penalty apeared on a 16x1.3GHz Processor
Marvel with 64 GB of ram to a process that had 3312 pagelets working set.
For lesser systems the performance may prove unnacceptably slow.
Peter Prymmer