From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 25878 invoked from network); 27 Nov 1998 13:29:28 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 27 Nov 1998 13:29:28 -0000 Received: from flow.geo.vu.nl (flow.geo.vu.nl [130.37.64.19]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id IAA03792 for ; Fri, 27 Nov 1998 08:28:35 -0500 Received: (from schj@localhost) by flow.geo.vu.nl (8.8.7/8.8.5) id OAA27657; Fri, 27 Nov 1998 14:27:56 +0100 From: Jaap Schellekens MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 27 Nov 1998 14:27:55 +0100 (MET) To: axp-list@redhat.com Subject: Re: Binary search speed in Alpha In-Reply-To: <19981127085841Z92268-18653+2@mea.tmt.tele.fi> References: <13918.31089.348053.439622@flow.geo.vu.nl> <19981127085841Z92268-18653+2@mea.tmt.tele.fi> X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-ID: <13918.42883.521767.555763@flow.geo.vu.nl> 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