[m-dev.] Re: more problems with t234.
Fergus Henderson
fjh at cs.mu.oz.au
Sat Apr 5 21:19:00 AEST 1997
Zoltan Somogyi, you wrote:
>
> Chris wrote:
> > I think that a solution to the problem would be to have seperate
> > predicates for set, set2 and set3.
What is the problem that Chris is referring to?
> > The case for the empty and four
> > nodes would be handled in set. I think that this implementation could
> > also be made to run more efficiently than the previous implementation.
>
> Yesterday I modified set and insert to make sure that we always got balanced
> trees (and to make variable names more meaningful), and applied the
> optimization that reduces the number of variables saved across calls.
> The results were excellent: a speedup of around 35%.
That is huge. Great stuff.
> Today I followed Chris's suggestion. While using separate set2 and set3
> predicates eliminates indexing in the called predicate, it requires extra
> indexing in the called predicate. Previously, we used an if-then-else
> to check for whether the selected subnode was a four-node or not; we
> must now also check whether it is a two-node, three-node or empty, and
> act accordingly. The result is no speedup, but no real slowdown either.
[...]
> Given that the third version is at worst marginally worse than the second,
> and that termination analysis should do better on it, that's the one I intend
> to check in. Any objections?
Ah, if versions 2 and 3 are equally efficient, then the criteria for
deciding which one to include should be simplicity, IMHO.
Why should we care how well termination analysis does on it?
> The diff for tree234.m is unreadable. Here is the affected portion of the
> new version of the file.
In general, if the results of `diff -u' are unreadable, try using `diff -c'.
Context diffs (rather than unified diffs) are almost always readable.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
More information about the developers
mailing list