On Fri, 2009-09-11 at 03:42 -0700, Derick Eddington wrote: > On Thu, 2009-09-10 at 22:53 -0700, Derick Eddington wrote: > > Darn, my stack-lang implementation sucks: > > > > [...] > > > > As you can see, the same algorithm took mine 7.2 seconds and took Factor > > only 0.6 second. > > > > I'm not sure why mine is so slow. I suspect it's because my data stack > > is an SRFI-39 parameter and it is used heavily. I'm going to change my > > implementation to pass and return the data stack through "word" > > procedure calls, to see if that helps. > > I did that and it brought the time down to 3.3 seconds, but it's still > allocating 1.4 GB. > > [...] > > But I think I'll try making a pre-allocated > block-allocated stack using a linked list of vectors and make convenient > abstractions for working with it. Does that seem worthwhile?
Actually, I'm not so sure that would be faster than a list. But I don't know. Cons'ing is pretty darn fast and minimal instructions, right? -- versus vector index-marker checking and arithmetic and vector accessing and mutating. Is there a more efficient representation than a list...? In any case, I'm moving into a new house starting tomorrow, so I'll be M.I.A. for a little while. I just committed my latest stack-lang in revision 186 for anyone who cares. -- : Derick ----------------------------------------------------------------
