parts respectively don't have much effect on the overall speedup when the 4th part (48% of the execution time) is accelerated by only 1.6 times. Serial programs [[File:Optimizing-different-parts.svg|thumb|400px|Assume that a task has two independent parts, A and B. Part B takes roughly 25% of the time of the whole computation. By working very hard, one may be able to make this part 5 times faster, but this reduces the time of the whole computation only slightly. In contrast, one may need to perform less work to make part A perform twice as fast. This will make the computation much faster than by optimizing part B, even though part B'''s speedup is greater in terms of the ratio, (5 times versus 2 times).]] For example, with a serial program in two parts A and B for which and , if part B is made to run 5 times faster, that is and , then if part A is made to run 2 times faster, that is and , then Therefore, making part A to run 2 times faster is better than making part B to run 5 times faster. The percentage improvement in speed can be calculated as Improving part A by a factor of 2 will increase overall program speed by a factor of 1.60, which makes it 37.5% faster than the original computation. However, improving part B by a factor of 5, which presumably requires more effort, will achieve an overall speedup factor of 1.25 only, which makes it 20% faster. Optimizing the sequential part of parallel programs If the non-parallelizable part is optimized by a factor of , then It follows from Amdahl's law that the speedup due to parallelism is given by When , we have , meaning that the speedup is measured with respect to the execution time after the non-parallelizable part is optimized. When , If , and , then: Transforming sequential parts of parallel programs into parallelizable Next, we consider the case wherein the non-parallelizable part is reduced by a factor of , and the parallelizable part is correspondingly increased. Then It follows from Amdahl's law that the speedup due to parallelism is given by The derivation above is in agreement with Jakob Jenkov's analysis of the execution time vs. speedup tradeoff. Relation to the law of diminishing returns Amdahl's law is often conflated with the law of diminishing returns, whereas only a special