Thanks for your respose with another eclipse.p.
One more question, what kind of BigNum is ECLiPSe
Prolog using.
Under the hood, what kind of library is used.
I know that SWI-Prolog uses GNU, and its two
times faster than Java BigInteger usually. I did
some testing with SWI-Prolog versus Jekejeke Prolog:
SWI-Prolog
?- time(fac(100000, 1, _)).
% 200,002 inferences, 1.609 CPU in 1.730 seconds (93% CPU, 124273 Lips)
true.
Jekejeke-Prolog (using 2G Mem to lower GC Pressure):
?- time(fac(100000, 1, _)).
% Up 2,667 ms, GC 29 ms, Thread Cpu 2,625 ms (Current 01/31/18 11:01:09)
Yes
If I use less memory like 512M, my system is slower,
since there is more GC pressure. But somehow its faster
then ECLiPSe Prolog with 2.69s according to this SO post:
Why a bignumber is shown incomplete in ECLiPSe Prolog?
https://stackoverflow.com/a/48530979/502187
So I wonder what kind of bignum are used in
ECLiPSe Prolog. Its quite stunning that GNU
beats Java BigInteger all the time, since
Java BigInteger uses all kind of tricks, like
extra fast multiplication (Karatsuba and Toom Cook)
when the arguments are large. But GNU is always
a little faster, couldn't beat it so far. And
in the above code of fac/3 its pratically irrelevant
how fast your Prolog interpreter is, the dominating
time factor will be the number Prolog ALU I guess.