<p>This kind of "laws" are usually labelled as <a href="http://en.wikipedia.org/wiki/Pareto_principle" rel="nofollow">Pareto principle</a>, or <a href="http://www.investopedia.com/terms/1/80-20-rule.asp" rel="nofollow">80–20 rule</a>:</p>

<h2>Answering specifically your question(s)</h2>

<p>1) This law is true in the real sense, or is just an observation, a presumption?</p>

<ul>
<li>This law is just an observation, and was explained more formally as a property of exponential distributions or power law. Then the observation is just the assumption that a given process can be modelled by such a distribution. </li>
</ul>

<p>2) If yes, there is a demonstration of this law?</p>

<ul>
<li>There is no demonstration that the contribution of the code to execution time follow an exponential law, and I think that there are known counter-examples: I remember a talk showing that Linux Kernel's source had a distinct distribution (biased by the proportion of code assigned to drivers). </li>
</ul>

<p>3) And, if possible, can this be proved somehow from a small program?</p>

<ul>
<li>This is typically shown (not proved, because it depends of the input of your program) via <a href="http://en.wikipedia.org/wiki/Profiling_%28computer_programming%29" rel="nofollow">profiling</a>.</li>
</ul>

<h2>Some useful reference and facts</h2>

<p>1) Pareto Principle in general </p>

<p>The Pareto Principle is named after Vilfredo Pareto, who introduced it to describe the distribution of wealth (dixit <a href="http://management.about.com/cs/generalmanagement/a/Pareto081202.htm" rel="nofollow">management.about.com</a>, because "twenty percent of the people owned eighty percent of the wealth") in the early 1900s. It has been applied in popular media to describe the state of many other unrelated systems, as for example by <a href="http://en.wikipedia.org/wiki/Timothy_Ferriss" rel="nofollow">Tim Ferriss</a> stating that <a href="http://www.lifehack.org/articles/lifestyle/interview-with-tim-ferriss-of-the-4-hour-workweek-part-1.html" rel="nofollow">20% of your clients generate 80% of your revenue</a> (so that you can afford losing 80% of your clients if it frees time to increase your revenue by 20%). The formal definition from <a href="http://www.investopedia.com/terms/1/80-20-rule.asp" rel="nofollow">http://www.investopedia.com</a> is "A rule of thumb that states that 80% of outcomes can be attributed to 20% of the causes for a given event."</p>

<p>2) Pareto Principle in Computer Science </p>

<p>The Pareto principle is no more than a particular property of <a href="http://en.wikipedia.org/wiki/Power_law" rel="nofollow">power laws</a> and <a href="http://en.wikipedia.org/wiki/Exponential_distribution" rel="nofollow">exponential distributions</a>. Since it has entered the popular culture it has been misused in various ways, I think that researchers prefer to refer define models using power laws and using their properties rather than referring to the Pareto principle and risk being misunderstood. The fact that the only example about computer science in the <a href="http://en.wikipedia.org/wiki/Pareto_principle#Mathematical_notes" rel="nofollow">wikipedia page on the Pareto Principle</a> is 2 lines long and about Microsoft supports this intuition.</p>

<p>3) Pareto Principle on Execution time</p>

<p>Concerning the execution time, I found only a few references to the application you mentioned, i.e. "<a href="http://programmingopinions.blogspot.com/2009/12/impact-of-pareto-principle-in.html" rel="nofollow">only a small portion (10%-20%) of the overall code is actually performance critical</a>" on <a href="http://programmingopinions.blogspot.com" rel="nofollow">http://programmingopinions.blogspot.com</a>, and even there they do insist that it is a rule of thumb, not a real property (as one would expect). Dixit <a href="http://www.codeproject.com" rel="nofollow">http://www.codeproject.com</a>, "<a href="http://www.codeproject.com/Articles/49023/The-impact-of-the-Pareto-principle-in-optimization" rel="nofollow">Although the Pareto principle is frequently mentioned in software optimization discussions, the way this principle affects the optimization process is usually left obscure.</a>"</p>

<p>I hope it helps!</p>

CC BY-SA 3.0
2013-09-17T13:17:38.987Z
2013-09-17T13:33:38.577Z
2013-09-17T13:33:38.577Z
J.y B.y
<p>I found this "law" somewhere on <a href="http://en.wikipedia.org/wiki/Program_optimization" rel="nofollow">Wikipedia</a>:</p>

<blockquote>
  <p>In software engineering, it is often a better approximation that 90% of the execution time of a computer program is spent executing 10% of the code (known as the 90/10 law in this context).</p>
</blockquote>

<p>Now I'm interested to find something more about this low (googling, didn't help me too much) like:</p>

<ul>
<li><p>This law is true in the real sense, or is just an observation, a presumption?</p></li>
<li><p>If yes, there is a demonstration of this law?</p></li>
<li><p>And, if possible, can this be proved somehow from a small program?</p></li>
</ul>

CC BY-SA 3.0
2013-09-17T17:11:35.623Z
its not a law, more of a trend/empirical observation done through profiling real human-generated code, and has to do with looping, where much execution is inside of loops. theoretically/roughly a TM can be built/constructed that has whatever statistical distribution of state-visit-frequency ("profile") that is desired (and thereby 'violating' the principle). used in eg compiler/cpu design research where it is exploited in optimization strategies. however, a theoretical model: [TM run sequence compression](http://mathoverflow.net/questions/86339/compression-of-a-turing-machine-run-sequence)
vzn
CC BY-SA 3.0
2013-09-18T02:20:52.400Z
I think this is more suitable for [cs.se], please see [about] and [help/on-topic].
Kaveh
<optimization><software><se.software-engineering>
Program optimization - 90/10 law
Radu Rădeanu
# Program optimization - 90/10 law

(Asked by: username_0 on 2013-09-17)

I found this "law" somewhere on [Wikipedia](http://en.wikipedia.org/wiki/Program_optimization):

> In software engineering, it is often a better approximation that 90% of the execution time of a computer program is spent executing 10% of the code (known as the 90/10 law in this context).

Now I'm interested to find something more about this low (googling, didn't help me too much) like:

* This law is true in the real sense, or is just an observation, a presumption?
* If yes, there is a demonstration of this law?
* And, if possible, can this be proved somehow from a small program?

**Tags:** optimization, software, se.software-engineering
> **Comments:**
> **username_1**: its not a law, more of a trend/empirical observation done through profiling real human-generated code, and has to do with looping, where much execution is inside of loops. theoretically/roughly a TM can be built/constructed that has whatever statistical distribution of state-visit-frequency ("profile") that is desired (and thereby 'violating' the principle). used in eg compiler/cpu design research where it is exploited in optimization strategies. however, a theoretical model: [TM run sequence compression](http://mathoverflow.net/questions/86339/compression-of-a-turing-machine-run-sequence)  
> **username_2**: I think this is more suitable for [cs.se], please see [about] and [help/on-topic].  

---

## 1 answers

### Answer by username_3 on 2013-09-17. Score: 3 | Accepted answer

This kind of "laws" are usually labelled as [Pareto principle](http://en.wikipedia.org/wiki/Pareto_principle), or [80–20 rule](http://www.investopedia.com/terms/1/80-20-rule.asp):

## Answering specifically your question(s)

1) This law is true in the real sense, or is just an observation, a presumption?

* This law is just an observation, and was explained more formally as a property of exponential distributions or power law. Then the observation is just the assumption that a given process can be modelled by such a distribution.

2) If yes, there is a demonstration of this law?

* There is no demonstration that the contribution of the code to execution time follow an exponential law, and I think that there are known counter-examples: I remember a talk showing that Linux Kernel's source had a distinct distribution (biased by the proportion of code assigned to drivers).

3) And, if possible, can this be proved somehow from a small program?

* This is typically shown (not proved, because it depends of the input of your program) via [profiling](http://en.wikipedia.org/wiki/Profiling_%28computer_programming%29).

## Some useful reference and facts

1) Pareto Principle in general

The Pareto Principle is named after Vilfredo Pareto, who introduced it to describe the distribution of wealth (dixit [management.about.com](http://management.about.com/cs/generalmanagement/a/Pareto081202.htm), because "twenty percent of the people owned eighty percent of the wealth") in the early 1900s. It has been applied in popular media to describe the state of many other unrelated systems, as for example by [Tim Ferriss](http://en.wikipedia.org/wiki/Timothy_Ferriss) stating that [20% of your clients generate 80% of your revenue](http://www.lifehack.org/articles/lifestyle/interview-with-tim-ferriss-of-the-4-hour-workweek-part-1.html) (so that you can afford losing 80% of your clients if it frees time to increase your revenue by 20%). The formal definition from [http://www.investopedia.com](http://www.investopedia.com/terms/1/80-20-rule.asp) is "A rule of thumb that states that 80% of outcomes can be attributed to 20% of the causes for a given event."

2) Pareto Principle in Computer Science

The Pareto principle is no more than a particular property of [power laws](http://en.wikipedia.org/wiki/Power_law) and [exponential distributions](http://en.wikipedia.org/wiki/Exponential_distribution). Since it has entered the popular culture it has been misused in various ways, I think that researchers prefer to refer define models using power laws and using their properties rather than referring to the Pareto principle and risk being misunderstood. The fact that the only example about computer science in the [wikipedia page on the Pareto Principle](http://en.wikipedia.org/wiki/Pareto_principle#Mathematical_notes) is 2 lines long and about Microsoft supports this intuition.

3) Pareto Principle on Execution time

Concerning the execution time, I found only a few references to the application you mentioned, i.e. "[only a small portion (10%-20%) of the overall code is actually performance critical](http://programmingopinions.blogspot.com/2009/12/impact-of-pareto-principle-in.html)" on <http://programmingopinions.blogspot.com>, and even there they do insist that it is a rule of thumb, not a real property (as one would expect). Dixit <http://www.codeproject.com>, "[Although the Pareto principle is frequently mentioned in software optimization discussions, the way this principle affects the optimization process is usually left obscure.](http://www.codeproject.com/Articles/49023/The-impact-of-the-Pareto-principle-in-optimization)"

I hope it helps!


---

