Article View: comp.lang.prolog
Article #1543Re: Efficiency
From: Micha Meier
Date: Mon, 05 Oct 1992 10:21
Date: Mon, 05 Oct 1992 10:21
25 lines
1987 bytes
1987 bytes
In article 28120@athena.cs.uga.edu, mcovingt@aisun3.ai.uga.edu (Michael Covington) writes: > - Efficiency of execution > (That's right, if you're using backtracking and unification then > your program will probably run as fast under Prolog as under any > other language. We once ported a simple Prolog list processing > routine into Pascal as a test, and got a factor-of-14 *slowdown*!) It is nice that People really do believe in Prolog, but there must be a mistake here. The fact that you use unification and backtracking does not make your program faster, it may simplify the algorithm, though. When one rewrites list processing procedures to C, one certainly gets a significant speedup, maybe 3 - 10. You must have dome something funny in your Pascal translation, or it was a very slow Pascal. In fact it is unification, backtracking, and logical variables, i.e. the particular Prolog features, that make it slower than other languages. The current compiler technology moves towards eliminating this overhead by recognizing deterministic code in place of backtrackable one, and assignments and tests in place of the unification, but it will take some time till we get there. --Micha --- Micha Meier ------------------------------------------------ ECRC, Arabellastr. 17 The opinions expressed above are private D-8000 Munich 81 and may not reflect those of my employer. micha@ecrc.de, Tel. +49-89-92699-108, Fax +49-89-92699-170
Technical Details
Message-ID:
<1992Oct5.102142.16636@ecrc.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!darwin.sura.net!Sirius.dfn.de!dct.zrz.tu-berlin.de!cs.tu-berlin.de!news.netmbx.de!Germany.EU.net!ecrc!acrab6!michaReferences:
<1992Oct5.032836.28120@athena.cs.uga.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.prolog Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!darwin.sura.net!Sirius.dfn.de!dct.zrz.tu-berlin.de!cs.tu-berlin.de!news.netmbx.de!Germany.EU.net!ecrc!acrab6!micha From: micha@ecrc.de (Micha Meier) Subject: Re: Efficiency Message-ID: <1992Oct5.102142.16636@ecrc.de> Sender: news@ecrc.de Reply-To: micha@ecrc.de Organization: European Computer-Industry Research Centre References: <1992Oct5.032836.28120@athena.cs.uga.edu> Date: Mon, 5 Oct 1992 10:21:42 GMT Lines: 26