Memory latency for application software developers
Introduction
About memory latency
How latency impacts performance - part 1
How latency impacts performance - part 2
Cache alignment
Cache prefetching
Next Steps
Memory latency for application software developers
Review frequently asked questions
These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.
Differences are expected because processor and system details vary. Confirm that you built and ran the intended source file for each version, then compare relative changes rather than exact numbers.
Verify that the new allocator code is present and that you build
memory-latency2.c. Run the program and confirm that it completes without the allocator error message from the source.Apply the changes shown in the steps, then test the provided alternatives and compare runtime behavior. Keep the version that performs better on your Arm system.
Prefetch a few iterations ahead. Prefetching only the next iteration is often insufficient with typical RAM latency of about 100 ns. Adjust the distance empirically and keep the setting that improves runtime trends.
Build each variant, run it under the same conditions, and compare runtimes or other observable behavior. A consistent improvement across multiple runs indicates that the change benefits your system.