[comp.lang.prolog] slow bagof ?

bimbart@kulcs.uucp (Bart Demoen) (05/30/90)

In article <3081@goanna.cs.rmit.oz.au>,  ok@goanna.cs.rmit.oz.au
(Richard A. O'Keefe) writes:

> bagof/3 has to put the answers *somewhere*.  Some Prologs have a special
> 'setof stack' or a "bubble" in the heap.  Quintus Prolog basically does
> a special cheap assert and a special cheap retract

BIM_Prolog used its 'expensive' assert and retract a couple of years ago.
Consequently, bagof was ridiculously slow, but we didn't really care, after all,
we thought: "How many more copies of BIM_Prolog could be sold for each
x% speedup of bagof/3?" (this quoted sentence is almost a copy from the same
mail from Richard)
Then our CHAT80 benchmark results were embarrassingly slow, so we had to do
something about it. BIM_Prolog now has a special find_all datastructure, used
by setof and bagof as well. These predicates preserve the internal sharing
of the solutions and can handle cyclic terms, which our assert can't. Still
the ratio (call to bagof) / (call f directly) is 10 times better than quoted
by Richard, and believe me, it is not because calling f/1 is slow ! 


> How many more copies of Quintus Prolog could be sold for each x% speedup of
> bagof/3?

At this moment, we are interested in knowing X in the following statement:

	Many more copies of Prolog could be sold for each % speedup of X .

Any clues ?

bimbart@cs.kuleuven.ac.be