Home > Archive > Extreme Programming > March 2004 > Cache miss rate
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Niels Boldt 2004-03-26, 11:50 pm |
| Hi Guys
I'm working on some liquid simulation and have the following output from
valgrind(cachegrind)
...snip
----------------------------------------------------------------------------
----
I1 cache: 16384 B, 32 B, 4-way associative
D1 cache: 16384 B, 32 B, 4-way associative
L2 cache: 262144 B, 32 B, 8-way associative
...snip
----------------------------------------------------------------------------
----
Ir I1mr I2mr Dr D1mr D2mr Dw
D1mw D2mw
----------------------------------------------------------------------------
----
5,412,031,089 293,505 17,337 2,286,319,859 45,889,697 375,534 992,983,588
394,561 174,542 PROGRAM TOTALS
----------------------------------------------------------------------------
----
Ir I1mr I2mr Dr D1mr D2mr Dw
D1mw D2mw file:function
----------------------------------------------------------------------------
----
1,119,775,840 64 64 454,958,240 18,208,660 16 134,233,344 10,306
0 vector.hpp:_ZN12Interpolator14changedDensity
1,056,660,256 18 18 423,400,448 19,123,312 32 129,725,088 11,864
0 vector.hpp:_ZN12Interpolator14changedViscosity
119,376,708 46 6 69,636,413 1,490 1,440 39,792,236 50,421
47,646 vector.cpp:Vector3::operator=(Vector3 const&)
...snip
I do not have much experience with cache optimization and wonders if these
numbers are alarming. Most of the time is spent in the first two functions,
so I wonder if I get a serious performance degradation with the cache misses
for the two first functions and also with the level two cache misses of the
=operator. So my question is: Is it worth considering to optimize the
program for cache acces.
Please feel free to request more information.
Thanks Niels.
| |
| Paul Sinnett 2004-03-26, 11:50 pm |
| Niels Boldt wrote:
> Hi Guys
>
> I'm working on some liquid simulation and have the following output from
> valgrind(cachegrind)
I think you have the wrong group. This group discusses the software
development method called extreme programming. Although, the question
"how does extreme programming handle optimising routines at the
instruction cache level?" might be interesting to this group, I don't
think the answers would be of immediate help to you.
However, I can't think of a suitable group right now, either. You might
try one of the game programming groups.
> I do not have much experience with cache optimization and wonders if these
> numbers are alarming. Most of the time is spent in the first two functions,
> so I wonder if I get a serious performance degradation with the cache misses
> for the two first functions and also with the level two cache misses of the
> =operator. So my question is: Is it worth considering to optimize the
> program for cache acces.
A rough rule of thumb is a penalty of 10x for a level 1 cache miss and
200x for a level 2 cache miss. From your figures, just under a quarter
of the total reading and writing time of your program is spent on cache
misses in those three functions. Optimising for cache access might save
you quite a chunk.
Alternatively, there might be better areas to optimise first. These
could eliminate the cache issues as a side-effect. For example, have you
tried inlining the Vector3 assignment operator?
What is your performance target, in percentage terms?
What have you already tried?
|
|
|
|
|