From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 15172 invoked from network); 28 Nov 1998 19:14:16 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 28 Nov 1998 19:14:16 -0000 Received: from norad.dodds.net (scorpio@westgate-190-203.res.iastate.edu [129.186.190.203]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id OAA08299 for ; Sat, 28 Nov 1998 14:12:58 -0500 Received: from localhost (scorpio@localhost) by norad.dodds.net (8.8.5/8.8.5) with SMTP id NAA00718 for ; Sat, 28 Nov 1998 13:12:57 -0600 Date: Sat, 28 Nov 1998 13:12:57 -0600 (CST) From: Bibek Sahu To: axp-list@redhat.com Subject: Re: Binary search speed in Alpha In-Reply-To: <13918.42883.521767.555763@flow.geo.vu.nl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Assembly Language Programmer's Guide: http://www.partner.digital.com/www-swdev/pages/Home/TECH/documents/Digital_UNIX/V4.0/AA-PS31D-TET1_html/TOC.html Enjoy. - Bob On Fri, 27 Nov 1998, Jaap Schellekens wrote: > Matti Aarnio writes: > > > that has a better performance on an Alpha. I suspect the > > > memory access pattern of the binary search I use does not > > > favour the Alpha architecture a lot. Some numbers (seconds): > > > > How large is the table ? > > About 300 rows, > ... > > > > Alpha's memory subsystem is very good at pulling in (and also > > writing) large amounts of *sequential* data, in fact so good, > > that you can get at least 10-20 sequential data entries in > > within the time you do a *single* random walk step. (And you > > may get even more dramatic boosts with SDRAM based 21164 systems, > > I don't remember what the XL300 has in it.) > > Plain fpram (128 bit wide) > > > So yes, surprisingly you could perhaps get best performance by > > doing simple linear search. Of course the log(N) is better when > > the N is very large, but up to N=100 (?) that might not be the case. > > Tried that but it performs quite a lot slower. I forgot to mention > that I already keep the last position in the table as a starting > point becuase the answer is usually close to the previous one. > > > the cache. The amount of data does exceed the amount of > > L1 cache at the CPU ? Then timely preloads will help. > > I think that the 96kb should be enough.. > > > That preload trick is not quite simple, nor I have my reference > > books with me now. But essentially: > > > > preload(srcaddr) > > for (...) { > > preload(srcaddr+preload_stride) > > scan_blob(srcaddr) > > srcaddr += preload_stride > > } > > > > The scan processing must handle the amount of data given > > in preload_stride, which in turn must be some power-of-2 > > given to the preload instruction, if I remember correctly. > > Sounds interesting if there are any refereces to book or other info > that describe how to do this please let me know. > > Thanks a lot, > > Jaap > > -- > -------------------------------------------------------------- > Jaap Schellekens E-mail: schj@geo.vu.nl > Hydro(geo)logy Dept. Fax: ++31 20 6462457 > Inst. of Earth Sc. Voice: ++31 20 4447287 > Vrije Universiteit > De Boelelaan 1085 use finger schj@flow.geo.vu.nl > for extra information > 1081 HV Amsterdam NL See also: http://flow.geo.vu.nl > > -- > To unsubscribe: send e-mail to axp-list-request@redhat.com with > 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com >