What is the best way to detect processor cache flaws when running an algorithm?

We have an algorithm that does not work well, and we believe in this because of processor cache flaws. However, we cannot prove this because we have no way to detect them. Is there a way to tell how many processor caches the algorithm will skip? We can transfer it to any language that can allow us to detect them.

Thanks in advance.

+4
source share
2 answers

The easiest way to find such problems is to use profilers and collect cache performance counters.

I would recommend checking out the following tools:

Is it possible to view the general structure of your algorithm (if it is not too long)?

+2
source

Intel processors store performance counters that you can retrieve with some assembler instructions.

Could you (1) skip the basic cache in the system at rest, (2) run the program and compare?

See Volume 3B Intel's instruction set reference . 18-18 for the assembler that you will need to write.

0
source

Source: https://habr.com/ru/post/1389478/


All Articles