[mercury-users] Is Mercury as fast as C?

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Apr 20 13:32:05 AEST 2001


On 19-Apr-2001, Terrence Brannon <princepawn at earthlink.net> wrote:
> 
> I was impressed with the section "Determinism" in the manual. The
> ability of the compiler to know about the number of solutions in
> advance is a huge step forward from a blind interpreter chasing
> unification after unification without any expectations on the outcome
> of the search.
> 
> The question therefore arises: although it is well-known that Mercury
> is several times faster than any Prolog that has ever been written,
> does it solve problems that we have C programs for as fast as C? If
> not, why not?

The major difference is garbage collection.

If you put a bit of effort into optimizing your Mercury programs, then in my
experience you can get performance which is reasonably competitive with C.

At this point the efficiency differences are small enough that I think
for the vast majority of programs efficiency issues would be only a
very minor factor in deciding whether to prefer Mercury or C.
Other issues, such as development cost, maintainability, 
portability, interfaces to third-party libraries, and so forth
are likely to be much more important.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list