Re: question about last call optimization



"Joachim Schimpf" <j.schimpf@xxxxxxxxxxxxxx> wrote in message
news:dcvir2$lfe$1@xxxxxxxxxxxxxxxxxxx
> Nameless wrote:
>>
>> Ok, but does this explain why there is up to 50% increase
>> in execution time vis-a-vis clauses with cuts?
>
> The variants which are comparable are test2 and test3 (these
> differ only in that test2 uses two clauses with cut, while
> test3 uses if-then-else). Here you have a 15% increase, not 50.
>
> Actually, i see now that my explanation involving environments
> was wrong, sorry. The slowdown is due to test2 using indexing,
> where test3 creates a choicepoint.
>>
>> Note: this 50% increase has resulted in that I have more or
>> less ceased using if-then-else constructs in ECLiPSe. :(
>>
> Apart from the fact that there is no 50% increase (unless you
> compare versions with slightly different semantics like test4
> and test5), such a conclusion would be wrong in general.

Well, Joachim, I did say 'up to'. Besides, test3 is just
about as simple as it can get! You know, I can send you an
example that does exhibit 50% increase, to show you that I
am not exaggerating.

> Whether an if-then-else version is faster or slower than a
> multi-clause-cut version depends on a number of factors, some
> of which are not obvious even when you know something about
> WAM implementations, e.g.
> - presence of indexable information in the condition
> - whether the condition is simple or complex
> - number of arguments of the clause
> - number of permanent variables in the clause

I concur.

> The good news is that in my plans for a new ECLiPSe compiler,
> I'm making sure that both versions have the same performance.
> The bad news is, I don't know if we'll ever get round to
> implementing it :-/

Please do try (harder)! ;)

--
Mail sent to this email address is deleted unread
on the server. Please send replies to the newsgroup.


.



Relevant Pages

  • Re: Containstable problem
    ... When you have restictions in your where clause you ... first 1000 rows don't have a source value of news. ... > SELECT TOP 1000 ID FROM tableX AS FT_TBL ...
    (microsoft.public.sqlserver.fulltext)
  • Re: ~Ing Adverbial Participles?
    ... in the main clause. ... Having watched the news, I went to sleep. ... resemble adverbials causal clause, in the same manner that because would ...
    (alt.usage.english)
  • Re: ~Ing Adverbial Participles?
    ... noun in the main clause. ... Having watched the news, I went to sleep. ... so those participles could well be parsed as modifying the ... one might advocate being wary of placing such modifiers ...
    (alt.usage.english)
  • Re: ~Ing Adverbial Participles?
    ... in the main clause. ... Having watched the news, I went to sleep. ... resemble adverbials causal clause, in the same manner that because would ...
    (alt.usage.english)
  • ~Ing Adverbial Participles?
    ... noun in the main clause. ... Having watched the news, I went to sleep. ... Jumping as high as she could, ...
    (alt.usage.english)