|
From: Charles R H. <cha...@gm...> - 2006-02-11 17:34:11
|
On 2/9/06, Travis Oliphant <oli...@ie...> wrote: > Sasha wrote: > > >Well, my results are different. > > > > [snip] > Yes, I think it's worth submitting. Most of the suggestions for > pointer-arithmetic for fast C-code were developed when processors spent > more time computing than fetching memory. Now it seem it's all about > fetching memory intelligently. > > The buffer[i]=3D > > style is even recommended according to the AMD-optimization book Sasha > pointed out. Pointers vs indexing is architecture and compiler dependent. My own experience is that recent gcc compilers produce better indexing code than they used to and the indexing instructions on newer cpus are faster. When I wrote the sorting routines pointers were faster, so I used them for quicksort and mergesort. Now I think indexing is faster and I am tempted to change the code. Indexing also looks cleaner to me. Chuck |