Read memory in random order
memory_read_random · compared across machine types · 8 Series on 8 machine types · AWS us-east-2
CPU
| Compare | Machine | Variant | P50 | P99 | Rate | Runs |
|---|---|---|---|---|---|---|
| c8a.2xlarge | 74.59 ms | — | 14.40 GB/s | 89 | ||
| c8g.2xlarge | 123.5 ms | — | 8.695 GB/s | 4 | ||
| i4g.2xlarge | 186.2 ms | — | 5.766 GB/s | 4 | ||
| c8i.2xlarge | 213.0 ms | — | 5.041 GB/s | 89 | ||
| c6i.8xlarge | 275.9 ms | — | 3.891 GB/s | 89 | ||
| i4i.2xlarge | 276.8 ms | — | 3.880 GB/s | 89 | ||
| m6id.2xlarge | 278.4 ms | — | 3.857 GB/s | 1 | ||
| m5.large | 308.4 ms | — | 3.481 GB/s | 91 |
Compared:m5.largec8g.2xlargec8i.2xlarge
Run-to-run spread
time per 1 GiB pass across counted RunsOver time
newest counted Runs, time per 1 GiB pass(one request each to the data API)
What this measures
How fast one thread reads a buffer in random order: the first word of every 64-byte element, in a shuffled order, with reads that do not depend on one another, so that many cache misses can be in flight at once. It is the throughput of random reads, not the latency of one.
What it does not measure
- It is not the latency of one read. Each read's address comes from the shuffled order, not from the read before it, so the reads can overlap; nothing records whether they did.
- Each repetition also reads the shuffled order front to back, 8 bytes per element.
- Bytes per second counts the 64 bytes of every element the loop reads from, of which the thread uses 8.
Code & config
Benchmark docsSeries JSONc8i.2xlarge
80__attribute__((noinline))81static uint64_t memory_read_random_run(void *arg) {82 const random_read_ctx_t *ctx = (const random_read_ctx_t *)arg;83 uint64_t sum = 0;84 for (size_t i = 0; i < ctx->elements; i++) {85 sum += ctx->data[ctx->order[i]].words[0];86 }87 return sum;88}// …130 lm_measure(memory_read_random_run, &ctx);
Configuration
- benchmarkmemory_read_random
- buildstatic
- instancec8i.2xlarge
- regionus-east-2
- azuse2-az3
- params.size_bytes1073741824
- params.threads1