Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 beta 3/9/83; site basser.SUN Path: utzoo!watmath!clyde!floyd!harpo!ulysses!unc!mcnc!decvax!mulga!munnari!basser!andrewt From: andrewt@basser.SUN (Andrew Taylor) Newsgroups: net.lang.prolog Subject: Re: Why I think partitions are faster than tagging. Message-ID: <256@basser.SUN> Date: Mon, 2-Apr-84 21:54:10 EST Article-I.D.: basser.256 Posted: Mon Apr 2 21:54:10 1984 Date-Received: Sat, 7-Apr-84 02:28:44 EST References: <4096@edai.UUCP> Organization: Dept of C.S., University of Sydney Lines: 33 I can not agree that a partitioned scheme is faster than tagging. edai!ok claims that the loop for de-referencing a variable is faster in a partioned scheme: { I can get this loop down to 4 instructions using C-Prolog's data representation, but with *byte* tags I can only get it down to 5 whichever end I put the tag. The VAX code is 11 bytes -vs- 19. The number of instructions would be the same on an M68000. } I use a tagged scheme. The compiled VAX code for the aforesaid loop involves only 3 instructions, 8 bytes. It lokes like this: jbr L1 L2: movl 4(r11),r11 L1: tstl (r11) jeql L2 A tagged scheme has other advantages. The unification routine can be table-driven. This is, I think, faster and it certainly is much cleaner. A partition scheme (or at least the Cprolog version thereof) involves horrible, heavily machine dependent, manipulations so that the bit patterns for integers, floats and pointers can be distinguished. Using a tagged scheme the various storage areas (stacks) can be small when created and "grown" to what ever size is necessary. This is harder to do in a partitioned scheme. The C-prolog approach of initially allocating ~1 megabyte is totally impractical in our environment. We have a swapping (non-virtual memory) system with 4Mb of memory and sometimes 20-30 students using prolog. Andrew Taylor