Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!news.sprintlink.net!news.ecrc.de!ecrc!news
From: joachim@ecrc.de (Joachim Schimpf)
Subject: Re: speed of prolog
Message-ID: <D9szyK.H10@ecrc.de>
Sender: news@ecrc.de
Reply-To: joachim@ecrc.de
Organization: European Computer-Industry Research Centre
References: <8024665948-33186@ai.univie.ac.at>
Date: Wed, 7 Jun 1995 12:56:44 GMT
Lines: 35

In article <8024665948-33186@ai.univie.ac.at>, christia@ai.univie.ac.at (Christian Holzbaur) writes:
>
>        n | GP/PARI |  clp(q)
>      ----+---------+--------
>       10 |    0.06 |    0.15
>       20 |    1.34 |    2.34
>       50 |   75.36 |  140.01
>      100 | 1589.32 | 2969.77
>
>    So C outperforms Prolog by a factor of 2 after all!
>    

I can confirm Christian's results. With ECLiPSe 3.5.1 and its rational
constraint solver library(r), which uses similar technology as clp(q),
I get the following results (also on a 50 MHz Sparc):

     n | ECLiPSe 3.5.1
   ----+---------------
    10 |    0.19
    20 |    1.82
    50 |   60.42
   100 |  974.67

Does that mean Prolog is faster than C?  After all, even the complexity
seems to be better!
Well, take it with a grain of salt. This benchmark depends mostly on the
speed of rational number multiplication, ie. just a small piece of code
in the system's runtime library...

-------------------------------------------------------------------------
 Joachim Schimpf                                Email    joachim@ecrc.de 
 European Computer-Industry Research Centre     Phone   +49 89 92699 111
 Arabellastrasse 17, D-81925 Munich, Germany    Fax     +49 89 92699 170


