aarons@cvaxa.sussex.ac.uk (Aaron Sloman) (07/30/88)
My thanks to Peter Ross for drawing my attention to the following. = From: tnphhbu@dutrun.UUCP (Hans Buurman) = Newsgroups: comp.lang.prolog = Subject: prolog speeds = Message-ID: <311@dutrun.UUCP> = Date: 21 Jul 88 13:30:01 GMT = Organization: Delft University of Technology,The Netherlands = Keywords: poplog, c-prolog = = We currently have Poplog on trial (on a sun 3/50). After having used it = for two days, I must say that it seems to be about twice as slow as = C-prolog, that I have also worked with on the same machine. ..... = From: cam@aiva.ed.ac.uk (Chris Malcolm) = Newsgroups: comp.lang.prolog = Subject: Re: prolog speeds = Date: 26 Jul 88 16:43:37 GMT = References: <311@dutrun.UUCP> = Organization: Dept. of AI, Univ. of Edinburgh, UK = = Poplog's garbage collection mechanism makes it unusually demanding of = memory. I found that my 4,000 line prolog (poplog) program ran about = five times faster in an 8Mbyte Sun3/160 as a 4Mbyte Sun3/160. .... ----------------------------------------------------------- Yes. Testing Poplog Prolog on a machine with a small amount of memory (by 1988 standards) will often give poor results. There are several different issues here. A. Poplog Prolog inherently requires more space than an equivalent Prolog with similar Prolog facilities because it includes the integrated editor VED, and also the full Pop-11 system (and, if you are using it, the Poplog Common Lisp subsystem). There is also quite a lot of space required for the mechanisms that handle big integers, ratios, complex numbers, arrays, processes, hashed properties, and compiler-building tools, not provided in all other Prologs. This means that on a small machine there's proportionately MUCH less space left over for user programs and structures, and consequently on a small machine, garbage collection will be much more frequent for Poplog Prolog than for a a stand-alone prolog. There may also be some reduction in speed due to the fact that Poplog supports a much wider variety of data-types, and uses keys rather than tags for type-checking. (Using tags -- i.e. type bits in pointers -- would reduce the size of addressible memory. We decided that with rapidly falling memory prices, within a few years such a decision would be regretted.) The relative disadvantage for Poplog Prolog will be less, the more memory your machine has. The Poplog garbage collector uses the stop-and-copy algorithm if there is enough space for it, and the time required for this depends ONLY on the amount of non-garbage on the heap. So by allocating a very large heap space, one can have infrequent garbage collections, each requiring a relatively small amount of time. (Paging on a small machine can, however, reduce this benefit.) By locking parts of the heap, you can further reduce the amount of copying and therefore time required for each garbage collection. (If there is not enough swap space for the copying algorithm Poplog V13.5 invokes a non-copying algorithm, which is generally a bit slower, though by reducing the need for paging it can, in some cases, be faster!). B. Because it provides mixed language facilities Poplog Prolog cannot make assumptions about reclaiming structures that a stand-alone Prolog can. E.g. temporary structures, including Prolog variables, may be passed to Pop-11 (or Lisp) procedures which can retain pointers to the structures in global variables or Pop data-structures. This rules out automatic reclamation in certain contexts and can therefore lead to more frequent garbage collections. Again, the relative disadvantage will depend on how much heap space you have. Some users find that the ability to code certain critical parts of their programs in Pop-11 enables them to obtain gains in total speed (and sometimes clarity too!) that far outweigh the disadvantages of Poplog Prolog compared with other prologs. But it really depends on your application, target machine requirements, etc. etc. C. Even when enough memory is available, users may have to do some experimenting to find the optimal amount of heap space to allocate. The larger the heap, the less frequent garbage collections will be. However as the heap grows (on a small machine) the more frequent paging is likely to become. Paging over ethernet, or via a slow disk can reduce the benefits of having fewer garbage collections. However this is partly a function of other activity on the same machine, something that is very hard to predict with Unix, even on a single-user machine. As regards point B (consequences of allowing mixed language programs with shared data-structures), it occurs to me that it may be possible to allow users of Poplog Prolog to declare certain predicates to be "pure". I.e. they will not store structures anywhere. In that case more temporary structures can be automatically reclaimed without the use of garbage collection. Aaron Sloman, School of Cognitive and Computing Sciences, Univ of Sussex, Brighton, BN1 9QN, England ARPANET : aarons%uk.ac.sussex.cvaxa@nss.cs.ucl.ac.uk aarons%uk.ac.sussex.cvaxa%nss.cs.ucl.ac.uk@relay.cs.net JANET aarons@cvaxa.sussex.ac.uk BITNET: aarons%uk.ac.sussex.cvaxa@uk.ac or aarons%uk.ac.sussex.cvaxa%ukacrl.bitnet@cunyvm.cuny.edu As a last resort (it costs us more...) UUCP: ...mcvax!ukc!cvaxa!aarons or aarons@cvaxa.uucp