Re: if then else
- From: Jan Wielemaker <jan@xxxxxxxxxxxxxxxxxxx>
- Date: 19 Feb 2008 20:52:16 GMT
On 2008-02-19, bart demoen <bmd@xxxxxxxxxxxxxx> wrote:
On Tue, 19 Feb 2008 08:33:50 +0000, Jan Wielemaker wrote:
On 2008-02-18, bart demoen <bmd@xxxxxxxxxxxxxx> wrote:...
Yap SICS SWI B-Prolog | hProlog
orig 480 590 2980 484 | 360
meant 820 960 9919 730 | 264
equiv 1010 950 10300 1440 | 264
Curious is also that == is significantly slower than = on many systems?
Why is that?
Maybe there is a misunderstanding here ?
equiv uses =
meant uses ==
== is not significantly slower in any system; == is marginally faster or
basically the same in all systems, except in B-Prolog; and Neng-Fa has
given the explanation: the B-Prolog compiler generates a new predicate for
the X = [] goal in an if-then-else.
I was a bit quick. I don't know how acurate the measurements are, but
the difference in YAP surprises me a little. SWI crosses a magic number,
but the actual difference is small. As said, unification of ground terms
is a little faster than == due to the fact that the code for == shares
with standard order comparison.
BTW, small performance differences are no problem; in my opinion, a
problem arises when there is a large difference (from 50% up to a factor
three) that favours a bad programming style.
I agree.
--- Jan
.
- References:
- if then else
- From: bart demoen
- Re: if then else
- From: Jan Wielemaker
- Re: if then else
- From: bart demoen
- if then else
- Prev by Date: Re: if then else
- Next by Date: Re: if then else
- Previous by thread: Re: if then else
- Next by thread: Re: if then else
- Index(es):
Relevant Pages
|
|