GNU Prolog append/3 is a little faster, which is strange,
since GNU Prolog is more known to be faster for
arithmetic, since it doesn't have bigint,
but append/3 seems to be faster:
/* GNU Prolog (interpreted) */
?- between(1,1000000,_), fail; true.
(15 ms) yes
?- between(1,1000000,_), append([1,2,3,4,5],[6],_), fail; true
(109 ms) yes
/* SWI-Prolog */
?- time((between(1,1000000,_), fail; true)).
% 999,998 inferences, 0.031 CPU in 0.028 seconds (111% CPU, 31999936 Lips)
true.
?- time((between(1,1000000,_), append([1,2,3,4,5],[6],_), fail; true)).
% 6,999,998 inferences, 0.156 CPU in 0.155 seconds
(100% CPU, 44799987 Lips)
true.
Subtracting Loop Time I get:
GNU Prolog (interpreted): 94 ms
SWI-Prolog: 155-28 = 127 ms
GNU Prolog has a native implementation of append,
by Pl_Append_3 in a file list_c.c. Woa!
Julio Di Egidio schrieb: