From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,df5754e791c11702 X-Google-Attributes: gid1164f8,public X-Google-Thread: f57db,df5754e791c11702 X-Google-Attributes: gidf57db,public X-Google-ArrivalTime: 1995-03-02 05:21:38 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!agate!tonks.EECS.Berkeley.EDU!peterm From: peterm@tonks.EECS.Berkeley.EDU (Peter Mardahl) Newsgroups: comp.benchmarks,comp.sys.dec Subject: Cache, performance, and data structures used by simulations Date: 1 Mar 1995 02:19:28 GMT Organization: University of California, Berkeley Message-ID: <3j0ljg$in7@agate.berkeley.edu> NNTP-Posting-Host: tonks.eecs.berkeley.edu Xref: bga.com comp.benchmarks:2848 comp.sys.dec:9615 This is really a question. We have been benchmarking a series of codes on different architectures. The two of most interest to us are AlphaStation 200 4/233 and HP 712/80. Both have 256k cache. I do not know the memory bandwidth of the HP, the AlphaStation's is 132MB/s. No swapping took place. We benchmarked two different codes on these systems, both scientific simulation programs. One of them gave a performance on each machine consistent with expectations based on SPECfp. (i.e., The alphastation was as much faster as we'd expect from SPECfp than the hp) The other code performed very badly on the Alphastation, it ran slightly SLOWER than the HP. (We expect the Alphastation to be 60% faster) The two codes perform nearly identical calculations, however they use different datastructures: One uses a structure like this for a particle: typedef struct { double x,y; double v1,v2,v3; } particle; particle *particles; /* array has dimension #particles */ The other one stores this information like this: double *x, *y, *v1, *v2, *v3; /* each array has dimension #particles */ Each code updates each particle in sequence, and accesses all the fields. We can't benchmark the two codes against each other, apples and oranges.... But the structure-based code gets just exactly the performance you'd expect from SPECfp while the array-based code does not. Our theory to explain this: The HP has a much better memory bandwidth/CPU speed ratio than the DEC The DEC can more efficiently cache the structure-based code than it can the array-based code, keeping the cpu busier, so it performs as expected, but the dec can't cache the array-based code as well, so it performs badly compared to the HP with its better memory-bandwidth. What do you all think? Are we right? Do you have a better theory? It's important that we know, because we may switch the array-based code over to structures if we can get a 30-60% speedup out of it. Please Cc: me any followups. Regards, Peter Mardahl