While waiting for 5.8.1 compile on my old linux box...which seems to have
Ian Cass's problem...I did some searching on the issue.
I assume you are refering to the thread "B::Bytecode ineffective" i found on
google.
Well Just for shits and giggles I decided to run a couple tests.
There seemed to be no real advantage with 5.8.1 beyond obfuscation. Tests
were stolen from parrot/examples/benchmarks. I can see using B::Bytecode
for obfuscation, but it is no joy to work with, B::Decrypt though very well
undocumented, does exist to "un-obfuscate". B::Bytecode borked over goto,
and I'm sure it borks over tons of other stuff. Unfortunatly i'm stuck in
training next week with no laptop, or i'd have tons of time to play with it.
Test code is at the bottom of this email.
Test 1:
[EMAIL PROTECTED] root]# time /usr/local/bin/perl -MByteLoader hi.plc
100000
100000
100000
111111
real 0m1.285s
user 0m1.250s
sys 0m0.040s
[EMAIL PROTECTED] root]# time /usr/local/bin/perl hi.pl
100000
100000
100000
111111
real 0m1.301s
user 0m1.210s
sys 0m0.080s
[EMAIL PROTECTED] root]# which par
/usr/local/bin/par
[EMAIL PROTECTED] root]# time /usr/local/bin/par hi.pl
100000
100000
100000
111111
real 0m1.488s
user 0m1.370s
sys 0m0.060s
Test 2:
[EMAIL PROTECTED] root]# sh hi2.sh
time /usr/local/bin/perl hi2.pl
real 0m11.010s
user 0m10.710s
sys 0m0.120s
time /usr/local/bin/perl -MByteLoader hi2.plc
real 0m11.086s
user 0m10.780s
sys 0m0.080s
time /usr/local/bin/par hi2.pl
real 0m11.270s
user 0m10.980s
sys 0m0.160s
Test 1:
======= Code hi.pl
#!/usr/bin/perl -w
use strict;
my (%ha, %hb, $i, @k, @nk, $s);
for ($i = 0; $i < 10; $i++) {
$s = chr(65 + $i);
push @k, $s;
}
for my $e (0..3) {
for ($i = 0; $i < 10; $i++) {
for $s (@k) {
my $nk = $s . chr(65 + $i);
push @nk, $nk;
}
}
@k = @nk;
@nk = ();
}
print scalar(@k), "\n";
my $j = 0;
for $s (@k) {
++$j;
$ha{$s} = 1;
}
print "$j\n";
print scalar keys(%ha), "\n";
print $ha{"AAAAA"};
print $ha{"ABCDE"};
print $ha{"BBBBB"};
print $ha{"CCCCC"};
print $ha{"HHHHH"};
print $ha{"IIIII"};
print "\n";
print "$] \n";
===== Code hi2.pl
foreach (1..10) {
my @arr;
foreach (1..10) {
$arr[$_] = buildarray();
}
my @arr1;
foreach (1..20) {
$arr1[$_] = buildarray();
}
my @arr2;
foreach (1..20) {
$arr2[$_] = buildarray();
}
}
sub buildarray {
my @foo;
foreach (1..20000) {
$foo[$_] = $_;
}
return [EMAIL PROTECTED];
}