-
Siarhei Siamashka authored
The C compiler may attempt to reorder read and write operations when accessing the source and destination buffers. So instead of sequential memory accesses we may get something like a "drunk master style" memory access pattern. Certain processors, such as ARM Cortex-A7, do not like such memory access pattern very much and it causes a major performance drop. The actual access pattern is unpredictable and is sensitive to the compiler version, optimization flags and even sometimes on some changes in unrelated parts of source code. So use the volatile keyword for the destination pointer in order to resolve this problem and make C benchmarks more deterministic. See https://github.com/ssvb/tinymembench/issues/7
Siarhei Siamashka authoredThe C compiler may attempt to reorder read and write operations when accessing the source and destination buffers. So instead of sequential memory accesses we may get something like a "drunk master style" memory access pattern. Certain processors, such as ARM Cortex-A7, do not like such memory access pattern very much and it causes a major performance drop. The actual access pattern is unpredictable and is sensitive to the compiler version, optimization flags and even sometimes on some changes in unrelated parts of source code. So use the volatile keyword for the destination pointer in order to resolve this problem and make C benchmarks more deterministic. See https://github.com/ssvb/tinymembench/issues/7