From: Ian Collins on
On 03/28/10 07:09 AM, Peter Olcott wrote:
> MemTest86 and it showed:
> Intel Core-i5 750 2.67 Ghz (quad core)
> 32K L1 88,893 MB/Sec
> 256K L2 37,560 MB/Sec
> 8 MB L3 26,145 MB/Sec
> 8.0 GB RAM 11,852 MB/Sec
>
> The resulting memory access speed is substantially slower
> than worst case cache hit ratio should provide.

From a C++ perspective, bad style? Seriously, this isn't a C++ question.

<snip>

> double Process(uint32 size, uint32 RandomSeed = 0) {
> std::vector<uint32> Data;
> double MBperSec;
> double duration;
> clock_t finish;
> Data.resize(size);
> Initialize(Data, size);
> clock_t start = clock();
> uint32 num = 0;
> for (uint32 N = 0; N< Max; N++)
> num = Data[num];

With one exception: I'd expect most optimisers to reduce this loop to a
op-op.

--
Ian Collins