ArticleslgStudy

computer science

Sun–Ni law

Sun–Ni law is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Sun–Ni law rather than just read about it. In short: Within theoretical computer science, the Sun–Ni law (or Sun and Ni's law, also known as memory-bounded speedup) is a memory-bounded speedup model which states that as computing power increases the corresponding increase in problem size is constrained by the system’s memory capacity. In general, as a system grows in computational power, the problems run on the system increase in size.

Key takeaways

  • Sun–Ni law belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Sun–Ni law to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Sun–Ni law from memory before moving on to harder problems.

Reference excerpt

Within theoretical computer science, the Sun–Ni law (or Sun and Ni's law, also known as memory-bounded speedup) is a memory-bounded speedup model which states that as computing power increases the corresponding increase in problem size is constrained by the system’s memory capacity. In general, as a system grows in computational power, the problems run on the system increase in size. Analogous to Amdahl's law, which says that the problem size remains constant as system sizes grow, and Gustafson's law, which proposes that the problem size should scale but be bound by a fixed amount of time, the Sun–Ni law states the problem size should scale but be bound by the memory capacity of the system. Sun–Ni law was initially proposed by Xian-He Sun and Lionel Ni at the Proceedings of IEEE Supercomputing Conference 1990. With the increasing disparity between CPU speed and memory data access latency, application execution time often depends on the memory speed of the system. As predicted by Sun and Ni, data access has become the premier performance bottleneck for high-end computing. From this one can see the intuition behind the law; as system resources increase, applications are often bottlenecked by memory speed and bandwidth, thus an application can achieve a larger speedup by utilizing all the memory capacity in the system. The law can be applied to different layers of a memory hierarchy system, from L1 cache to main memory. Through its memory-bounded function, W=G(M), it reveals the trade-off between computing and memory in algorithm and system architecture design. All three speedup models, Sun–Ni, Gustafson, and Amdahl, provide a metric to analyze speedup for parallel computing. Amdahl’s law focuses on the time reduction for a given fixed-size problem. Amdahl’s law states that the sequential portion of the problem (algorithm) limits the total speedup that can be achieved as system resources increase. Gustafson’s law suggests that it is beneficial to build a large-scale parallel system as the speedup can grow linearly with the system size if the problem size is scaled up to maintain a fixed execution time. Yet as memory access latency often becomes the dominant factor in an application’s execution time, applications may not scale up to meet the time bound constraint. The Sun–Ni law, instead of constraining the problem size by time, constrains the problem by the memory capacity of the system, or in other words bounds based on memory. The law is a generalization of Amdahl's Law and Gustafson's Law. When the memory-bounded function G(M)=1, it resolves to Amdahl's law; when the memory-bounded function G(M)=m, the number of processors, it resolves to Gustafson's law.

Derivation Let W ∗ {\displaystyle \textstyle W^{*}} be the scaled workload under a memory space constraint. The memory bounded speedup can be defined as:

Sequential Time to Solve W*/Parallel Time to Solve W*

Suppose f {\displaystyle \textstyle f} is the portion of the workload that can be parallelized and ( 1 − f ) {\displaystyle \textstyle (1-f)} is the sequential portion of the workload. Let y = g ( x ) {\displaystyle \textstyle y=g(x)} be the function that reflects the parallel workload increase factor as the memory capacity increases m times. Let: W = g ( M ) {\displaystyle \textstyle W=g(M)} and: W ∗ = g ( m ⋅ M ) {\displaystyle \textstyle W^{*}=g(m\cdot M)} where M {\displaystyle \textstyle M} is the memory capacity of one node. Thus, W ∗ = g ( m ⋅ g − 1 ( W ) ) {\displaystyle W^{*}=g(m\cdot g^{-1}(W))}

The memory bounded speedup is then:

( 1 − f ) W + f ⋅ g ( m ⋅ g − 1 ( W ) ) ( 1 − f ) W + f ⋅ g ( m ⋅ g − 1 ( W ) ) m {\displaystyle {\frac {(1-f)W+f\cdot g(m\cdot g^{-1}(W))}{(1-f)W+{\frac {f\cdot g(m\cdot g^{-1}(W))}{m}}}}}

For any power function g ( x ) = a x b {\displaystyle \textstyle g(x)=ax^{b}} and for any rational numbers a and b, we have:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Sun–Ni law

Start with the simplest possible case. Write down what Sun–Ni law claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Sun–Ni law before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Sun–Ni law ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Sun–Ni law

In research
Sun–Ni law appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Sun–Ni law in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Sun–Ni law is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer architecture statements, Theoretical computer science, so understanding it makes those chapters shorter.
In everyday life
Look for Sun–Ni law outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Sun–Ni law” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Sun–Ni law in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Sun–Ni law means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Sun–Ni law out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Sun–Ni law in simple terms?

Within theoretical computer science, the Sun–Ni law (or Sun and Ni's law, also known as memory-bounded speedup) is a memory-bounded speedup model which states that as computing power increases the corresponding increase in problem size is constrained by the system’s memory capacity. In general, as…

Why does Sun–Ni law matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Sun–Ni law?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Sun–Ni law.

Tags

  • Computer architecture statements
  • Theoretical computer science

Keep exploring