What is STREAM benchmark?

A benchmark that copies and adds large arrays to measure the memory bandwidth actually achievable.

Field: Performance Analysis

Japanese name: STREAMベンチマーク

What it measures

STREAM is a benchmark that performs four simple operations on large arrays to measure memory bandwidth. The four are copying (Copy), multiplying by a constant (Scale), adding two arrays (Add) and a combination of adding and scaling (Triad). Very little computation is involved, so most of the time goes to reading and writing memory. The arrays are made much larger than the cache so that the data is carried to and from main memory. The result is given as the number of bytes read and written per second.

How the bandwidth is counted

A double-precision value occupies 8 bytes. Copy is counted as 16 bytes per element: 8 bytes read and 8 bytes written. For arrays of 10 million elements, one pass counts as 160 MB. If that takes 0.016 s, the bandwidth is calculated as 160 MB ÷ 0.016 s = 10 GB/s. Add reads two arrays and writes one, so it is counted as 24 bytes per element. The passes are repeated several times in a measurement.

What the result is used for

The bandwidth calculated from the memory standard is an ideal upper limit. The STREAM value indicates the bandwidth a real program can use, and is usually below that limit. In the Roofline model, this value is often used to draw the sloped line set by memory bandwidth. If the value stops rising as threads are added, memory bandwidth has reached its ceiling. It helps in estimating the speed of scientific computing that processes large arrays in order.

Try it: questions about STREAM benchmark

What does the STREAM benchmark mainly measure?

  1. AThe CPU's peak floating-point rate
  2. BThe memory bandwidth actually achieved when copying or adding large arrays
  3. CStorage capacity
Show answer and explanation

Answer: B. The memory bandwidth actually achieved when copying or adding large arrays

STREAM performs four simple operations, copy, scale, add and a combination, on large arrays that do not fit in cache and measures bytes read and written per second. With almost no computation, results are determined by memory bandwidth. It shows how much bandwidth is actually usable compared with the theoretical figure and is also used to draw the slanted memory-bandwidth line in the Roofline model.

FAQ

Does it also show memory latency?

No. STREAM walks through arrays in order, so it measures bandwidth for sequential access. The speed of irregular access such as following pointers is governed by the latency of each access and needs a separate measurement.

What happens if the arrays fit in the cache?

The test then measures the speed of the cache, not of memory. The value comes out high but does not represent main-memory bandwidth. For that reason the rules call for arrays much larger than the cache capacity.

Books on Performance Analysis Ad

As an Amazon Associate I earn from qualifying purchases.

This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.

Back to the glossary