Re: WAM Vs. TOAM



On Thu, 15 Nov 2007 10:33:08 -0500, Neng-Fa Zhou wrote:

"bart demoen" <bmd@xxxxxxxxxxxxxx> wrote in message
news:pan.2007.11.15.07.43.55.704686@xxxxxxxxxxxxxxxxx
On Wed, 14 Nov 2007 16:56:47 -0500, Neng-Fa Zhou wrote:
top :- p(1000,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ; true.

p(X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,X13,X14,X15):-
X1=X15,
NewX1 is X1-1,
mytrue,
p(NewX1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,X13,X14,X15).


I think you missed the ; true in top.
The alternative is to replace \+(\+(top)) by \+(top) in ntimes/1, in case
you don't like the ; true.

Because X1=X15 (X1=1000, X15=15) fails immediately, mytrue is not even
executed. That is why it taks 0 ms.

I missed that completely when posting - I had replaced
dummy(X1=X15) with X1 > X2 in my variant, but posted something retyping it.
I must rely more on cut and paste - so what I intended:

p(X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,X13,X14,X15) :-
X1 > X2,
NewX1 is X1-1,
mytrue,
p(NewX1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,X13,X14,X15).


I said this because B-Prolog is twice as fast as Yap and Sicstus on this
program and you told me (at ICLP) that B-Prolog Version 7.0 is 20% faster
than hProlog on Mac (Version 7.1 is slightly faster) on this program.

I remember that moment. I only later realised that my hProlog version was
configured with some profiling on instead of off.
Your nrev result did baffle me though, until I saw the instruction
compression you did - clearly implementation not design :-)
And easy to do the same in any Prolog implementation.


Linux is not a good platform to compare systems unless you know
the same tagging is used and they are compiled with the same gcc.

Gcc runs on other operating systems than Linux: is none of these platforms
good for comparing systems then ?
I do not really see the point: one should always take into account the
C-compiler, and for gcc especially the version. I have seen nothing but
degradation since 2.95.<something> :-)
Since you are distributing binaries only, you can choose the best gcc
to do that on any platform.
BTW, is it true that 7.0b1 was faster on Linux than 7.1.b1 ?
I noticed that for tak.

I am curious about how hProlog is so fast on this program. This program is
not binary and in the original WAM the loading and storing of registers
should be very costly.

Wait a few more days - there will be a tech report about tak/4 :-)

Cheers

Bart Demoen
.