0

How can I create a simple demo program with Python or C which strongly depends on the performance of RAM? For example, a program which can tell the performance difference between high and low RAM frequencies, and/or bandwidth? This helps me understand in what ways better RAM is useful, without going into details of more complicated tasks.

marc_s
  • 704,970
  • 168
  • 1,303
  • 1,425
  • 1
    STREAM already exists and is written in plain C. [what does STREAM memory bandwidth benchmark really measure?](https://stackoverflow.com/q/56086993) has a reply from the author. Another simplistic benchmark attempt is [what does STREAM memory bandwidth benchmark really measure?](https://stackoverflow.com/q/56086993) which has an answer explaining the problems. – Peter Cordes May 24 '22 at 20:05
  • 1
    [Why does this code execute more slowly after strength-reducing multiplications to loop-carried additions?](https://stackoverflow.com/a/72333152) will bottleneck on memory bandwidth if tested with a larger array that doesn't fit in L1d cache. (But make sure to touch the memory first, before a timed region, so you're not just timing page faults: [Idiomatic way of performance evaluation?](https://stackoverflow.com/q/60291987)). – Peter Cordes May 24 '22 at 20:08
  • Another thing you can test is latency instead of bandwidth, e.g. iterating through a large linked list with nodes scattered around. Like in [Sharing a TLB entry between two logical CPUs (Intel)](https://stackoverflow.com/q/72291786) but not just 1 node per page, 1 node per cache line. Also relevant: https://blog.stuffedcow.net/2013/01/ivb-cache-replacement/ used some test code to look at miss rates. – Peter Cordes May 24 '22 at 20:11

0 Answers0