Importance of memory organization for speed

Nick B nick.barbalich at gmail.com
Sat Jun 14 17:16:44 PDT 2008


renoX wrote:
> Bill Cox a écrit :
>> Hi, all.
>>
>> Waaay back, there was a short discussion of optimizing memory layout
>> for speed.  I've written a simple benchmark that traverses large
>> graphs, one written in very carefully memory optimized C, the other
>> using C++/STL.  The C version is 15X faster, and uses 2X less memory
>> on my Ubuntu x64 Core Duo laptop.  Cachegrind shows the C version has
>> a 16.7X lower L2 cache miss rate, which accounts for the speed
>> difference.
>>
>> So, I'll just post again the importance of keeping memory layout
>> abstract, and hidden from the user.
> 
> Uh? What you just did is using your knowledge of the memory layout in C 
> to speedup your app, so it's the *opposite* of having the memory layout 
> hidden from the user!
> 
> I don't catch your point here..
> 
> Regards,
> renoX
> 
> 
>>  More and more, speed for memory
>> intensive applications is all about cache performance.  Benchmarks
>> can be found in the examples/graph_benchmark directory of svn for the
>> datadraw project:
>>
>> svn co https://datadraw.svn.sourceforge.net/svnroot/datadraw/trunk
>> datadraw
>>
>> Best regards, Bill


Hi there


Does any one know how to measure the L1 & L2 cache performance using D & 
  Tango or is the _only_ way to do this is to use Valgrind ?

regards
Nick B



More information about the Digitalmars-d mailing list