Alex Rivera | Logout

decreasing cache misses through good design

Asked 2009-01-20T10:02:49.230
23

How to decrease the number of possible cache misses when designing a C++ program?

Does inlining functions help every time? or is it good only when the program is CPU-bounded (i.e. the program is computation oriented not I/O oriented)?

Edit
Report

1 Answer

2

Allow CPU to prefetch data efficiently. For example you can decrease number cache misses processing multi-dimensional arrays by rows rather than by columns, unroll loops etc.

This kind of optimization depends on hardware architecture, so you better use some kind of platform-specific profiler like Intel VTune to detect possible problems with cache.

answered 2009-01-20T10:09:46.457

Your Answer