I'll see about getting some docs into the system so this stuff is actually
usable.
One thing that the current MMD system does *not* do is inherited methods.
PerlInt isa perlscalar isa scalar, but adding a MMD method on a scalar
doesn't do anything for PerlInts. That needs to be addressed.
Dan
> ... (More bizarrely, it's actually *faster* to use Integer PMCs, which
> do MMD, than it is to use PerlInt PMCs, which don't do MMD. Go figure :)
I don't have that here (Athlon). They are equally fast. PerlInts have
some overhead due to possible type morphing, though.
> I'll see about getting some docs into the system so this stuff is actually
> usable.
That would be really necessary. I've some troubles to follow the flow of
execution with MMD and how all these methods play together.
> One thing that the current MMD system does *not* do is inherited methods.
> PerlInt isa perlscalar isa scalar, but adding a MMD method on a scalar
> doesn't do anything for PerlInts. That needs to be addressed.
I've put in vtable->isa() sou you could do something like:
forall p (pmcs)
if p->isa(SELF->name) && p->type != SELF->type
add_mmd_meth(p)
> Dan
leo
> Dan Sugalski <d...@sidhe.org> wrote:
>
> > ... (More bizarrely, it's actually *faster* to use Integer PMCs, which
> > do MMD, than it is to use PerlInt PMCs, which don't do MMD. Go figure :)
>
> I don't have that here (Athlon). They are equally fast. PerlInts have
> some overhead due to possible type morphing, though.
Hrm. This system's showing the PerlInt at about 25% slower for a tight
division loop, though that's the most expensive case)
> > I'll see about getting some docs into the system so this stuff is actually
> > usable.
>
> That would be really necessary. I've some troubles to follow the flow of
> execution with MMD and how all these methods play together.
Prelim docs are in.
Dan
>> I don't have that here (Athlon). They are equally fast. PerlInts have
>> some overhead due to possible type morphing, though.
> Hrm. This system's showing the PerlInt at about 25% slower for a tight
> division loop, though that's the most expensive case)
Have it too now. It depends on the values. 10/2 (my original) is same
speed, 10/3 gives your oberved 25%. Its due to morphing the result to an
PerlNum.
BTW:
$ time perl -e'$a=10;$b=2; $i=5000000; $c=$a/$b for 0..$i'
real 0m3.955s
$ parrot -P mmd.imc # 10/3; unoptimized build, Athlon 800
1.507748
2.018662
$ parrot -j mmd.imc
1.319433
1.640584
> Prelim docs are in.
Thanks.
> Dan
leo
:r src/parrot-leo/mmd.imc
.sub _main
P0 = new Integer
P1 = new Integer
P2 = new Integer
P1 = 10
P2 = 3
I0 = 5000000
time N0
l1:
P0 = P1 / P2
dec I0
if I0 goto l1
time N1
sub N1, N0
print N1
print "\n"
P0 = new PerlInt
P1 = new PerlInt
P2 = new PerlInt
P1 = 10
P2 = 3
I0 = 5000000
time N0
l2:
P0 = P1 / P2
dec I0
if I0 goto l2
time N1
sub N1, N0
print N1
print "\n"
end
.end